summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorTian Tao <tiantao6@hisilicon.com>2021-02-09 11:43:28 +0300
committerGuenter Roeck <linux@roeck-us.net>2021-02-12 07:28:56 +0300
commit8c646ef145136a7b1781976c42802391d5b8522b (patch)
treec5250ef98685eb46105952fc585754bf573b419a /drivers/hwmon
parent9f56b8eb85927c6391216e4f35a7abb34847f0fd (diff)
downloadlinux-8c646ef145136a7b1781976c42802391d5b8522b.tar.xz
hwmon: (da9052) Switch to using the new API kobj_to_dev()
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/da9052-hwmon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/da9052-hwmon.c b/drivers/hwmon/da9052-hwmon.c
index 4af2fc309c28..ed6c5df94fdf 100644
--- a/drivers/hwmon/da9052-hwmon.c
+++ b/drivers/hwmon/da9052-hwmon.c
@@ -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);