]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
hwmon: (da9052) Switch to using the new API kobj_to_dev()
authorTian Tao <tiantao6@hisilicon.com>
Tue, 9 Feb 2021 08:43:28 +0000 (16:43 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 12 Feb 2021 04:28:56 +0000 (20:28 -0800)
Switch to using the new API kobj_to_dev() to fix the below warnning:
/drivers/hwmon/da9052-hwmon.c:302:60-61: WARNING opportunity for
kobj_to_dev().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1612860208-51088-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/da9052-hwmon.c

index 4af2fc309c28689ff4214f186fc3b27a38dad2c8..ed6c5df94fdfe60cf0571a50d15ae8da286077b3 100644 (file)
@@ -299,7 +299,7 @@ static ssize_t label_show(struct device *dev,
 static umode_t da9052_channel_is_visible(struct kobject *kobj,
                                         struct attribute *attr, int index)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct da9052_hwmon *hwmon = dev_get_drvdata(dev);
        struct device_attribute *dattr = container_of(attr,
                                struct device_attribute, attr);