summary refs log tree commit diff
path: root/drivers/hwmon/max16065.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-03-18 12:06:19 -0700
committerGuenter Roeck <linux@roeck-us.net>2021-04-20 06:50:14 -0700
commit9d2227bb9bd4ae799e77c0575452e7e5716658ea (patch)
tree34268feac8b1e332f50ac8619ed4a5c424b97825 /drivers/hwmon/max16065.c
parentf3e3464ec893409189cb1a0657c2eca31ca82504 (diff)
downloadlinux-9d2227bb9bd4ae799e77c0575452e7e5716658ea.tar.gz
hwmon: Use kobj_to_dev()
coccinelle complains about

WARNING opportunity for kobj_to_dev()

in several files, resulting in one-by-one patch submissions.
Handle all remaining instances in one go.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/max16065.c')
-rw-r--r--drivers/hwmon/max16065.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/hwmon/max16065.c b/drivers/hwmon/max16065.c
index a26226e7bc37..0de2da3e5c46 100644
--- a/drivers/hwmon/max16065.c
+++ b/drivers/hwmon/max16065.c
@@ -454,7 +454,7 @@ static struct attribute *max16065_max_attributes[] = {
 static umode_t max16065_basic_is_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 max16065_data *data = dev_get_drvdata(dev);
 	int index = n / 4;
 
@@ -466,7 +466,7 @@ static umode_t max16065_basic_is_visible(struct kobject *kobj,
 static umode_t max16065_secondary_is_visible(struct kobject *kobj,
 					     struct attribute *a, int index)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct max16065_data *data = dev_get_drvdata(dev);
 
 	if (index >= data->num_adc)