Skip to contentSkip to conversation

hwmon: (max6650): Switch to using the new API kobj_to_dev()

PATCH Applied Tian Tao 2 participants 2 messages Dec 31, 2020 – Jan 8, 2021

Subsystems (2)
lore
Share & tools
lore

Tian Tao

author
#0 lore raw

PATCH 1/1 hwmon: (max6650): 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/max6650.c:324:60-61: WARNING opportunity for kobj_to_dev().

---
 drivers/hwmon/max6650.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/max6650.c +1 -1
index cc7f298..f8d4534 100644
@@ -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;
 
Signature · 1 line
2.7.4
maintainer Applied
#1 lore raw
Quoted 5 lines · Tian Tao

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().

Applied.

Thanks,
Guenter