diff options
author | Tian Tao <tiantao6@hisilicon.com> | 2020-12-29 11:17:17 +0800 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2021-01-27 17:44:18 -0800 |
commit | 8bfc731e476793d94312044907708920077a3a3a (patch) | |
tree | 1d64c3f6480cbbeb9c9116e5534ee5e0914c3a2b | |
parent | f7a652182cc7f07cf658b8eee8d545ac109fd02e (diff) |
hwmon: (gpio-fan) Switch to using the new API kobj_to_dev()
fixed the following coccicheck:
drivers/hwmon/gpio-fan.c:302:60-61: WARNING opportunity for
kobj_to_dev()
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1609211837-54930-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/hwmon/gpio-fan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c index 3ea4021f267c..befe989ca7b9 100644 --- a/drivers/hwmon/gpio-fan.c +++ b/drivers/hwmon/gpio-fan.c @@ -299,7 +299,7 @@ static DEVICE_ATTR(fan1_target, 0644, fan1_input_show, set_rpm); static umode_t gpio_fan_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 gpio_fan_data *data = dev_get_drvdata(dev); if (index == 0 && !data->alarm_gpio) |