hwmon: (max6650) Switch to using the new API kobj_to_dev()
authorTian Tao <tiantao6@hisilicon.com>
Thu, 31 Dec 2020 01:03:41 +0000 (09:03 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 28 Jan 2021 01:44:18 +0000 (17:44 -0800)
Switch to using the new API kobj_to_dev() to fix the below warnning:
drivers/hwmon/max6650.c:324:60-61: WARNING opportunity for
kobj_to_dev().

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

index cc7f2980fe83410c9a80a0bb1cb65bf236854b04..f8d4534ce172efc91b0b00985a354f392f9c6775 100644 (file)
@@ -321,7 +321,7 @@ static SENSOR_DEVICE_ATTR_RO(gpio2_alarm, alarm, MAX6650_ALRM_GPIO2);
 static umode_t max6650_attrs_visible(struct kobject *kobj, struct attribute *a,
                                     int n)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        struct max6650_data *data = dev_get_drvdata(dev);
        struct device_attribute *devattr;