diff options
| author | ye xingchen <[email protected]> | 2022-08-11 01:32:03 +0000 |
|---|---|---|
| committer | Hans de Goede <[email protected]> | 2022-08-25 16:23:53 +0200 |
| commit | a8f9c36c4bb705af4b6054244ff9669cdd8dcf71 (patch) | |
| tree | 52fb388f6f0be7fafc776e8f55f985bf57de2d6b | |
| parent | 170f0da25dac630dacb920d043fb20e12c287520 (diff) | |
platform/x86: asus-wmi: Use kobj_to_dev()
Use kobj_to_dev() instead of open-coding it.
Reported-by: Zeal Robot <[email protected]>
Signed-off-by: ye xingchen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
| -rw-r--r-- | drivers/platform/x86/asus-wmi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c index b5c977d37bc1..e461299d938a 100644 --- a/drivers/platform/x86/asus-wmi.c +++ b/drivers/platform/x86/asus-wmi.c @@ -2006,7 +2006,7 @@ static struct attribute *hwmon_attributes[] = { 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 device *dev = kobj_to_dev(kobj); struct asus_wmi *asus = dev_get_drvdata(dev->parent); u32 value = ASUS_WMI_UNSUPPORTED_METHOD; @@ -3294,7 +3294,7 @@ static struct attribute *platform_attributes[] = { static umode_t asus_sysfs_is_visible(struct kobject *kobj, struct attribute *attr, int idx) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct asus_wmi *asus = dev_get_drvdata(dev); bool ok = true; int devid = -1; |