platform/x86: asus-wmi: Use dev_get_drvdata()
authorFuqian Huang <huangfq.daxian@gmail.com>
Mon, 1 Jul 2019 03:24:26 +0000 (11:24 +0800)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 3 Jul 2019 12:38:06 +0000 (15:38 +0300)
Using dev_get_drvdata directly.

Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c

index 508e6ad4779310fac66bef2f19a92978b13ed049..269ed7e9401358789ffaf7945d27c70c1e75d57a 100644 (file)
@@ -1402,8 +1402,7 @@ static umode_t asus_hwmon_sysfs_is_visible(struct kobject *kobj,
                                          struct attribute *attr, int idx)
 {
        struct device *dev = container_of(kobj, struct device, kobj);
-       struct platform_device *pdev = to_platform_device(dev->parent);
-       struct asus_wmi *asus = platform_get_drvdata(pdev);
+       struct asus_wmi *asus = dev_get_drvdata(dev->parent);
        int dev_id = -1;
        int fan_attr = -1;
        u32 value = ASUS_WMI_UNSUPPORTED_METHOD;