Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

hwmon: (ds1621) Use kobj_to_dev()

fixed the following coccicheck:
./drivers/hwmon/ds1621.c:329:60-61: WARNING opportunity
for kobj_to_dev().

Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Link: https://lore.kernel.org/r/1616032504-59817-1-git-send-email-tiantao6@hisilicon.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Tian Tao and committed by
Guenter Roeck
f3e3464e 23bc3caf

+1 -1
+1 -1
drivers/hwmon/ds1621.c
··· 326 326 static umode_t ds1621_attribute_visible(struct kobject *kobj, 327 327 struct attribute *attr, int index) 328 328 { 329 - struct device *dev = container_of(kobj, struct device, kobj); 329 + struct device *dev = kobj_to_dev(kobj); 330 330 struct ds1621_data *data = dev_get_drvdata(dev); 331 331 332 332 if (attr == &dev_attr_update_interval.attr)