From: Tian Tao Date: Thu, 26 Nov 2020 02:21:20 +0000 (+0800) Subject: hwmon: (abx500) Switch to using the new API kobj_to_dev() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=02c155cb321643df9400a9af082902fcff222ad9;p=linux.git hwmon: (abx500) Switch to using the new API kobj_to_dev() fixed the following coccicheck: drivers/hwmon/abx500.c:266:60-61: WARNING opportunity for kobj_to_dev(). Signed-off-by: Tian Tao Link: https://lore.kernel.org/r/1606357280-51921-1-git-send-email-tiantao6@hisilicon.com Signed-off-by: Guenter Roeck --- diff --git a/drivers/hwmon/abx500.c b/drivers/hwmon/abx500.c index 50e67cdd8e5e3..4b9648819836f 100644 --- a/drivers/hwmon/abx500.c +++ b/drivers/hwmon/abx500.c @@ -263,7 +263,7 @@ static ssize_t max_alarm_show(struct device *dev, static umode_t abx500_attrs_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct abx500_temp *data = dev_get_drvdata(dev); if (data->ops.is_visible)