]> Git Repo - linux.git/commitdiff
power-supply: use kobj_to_dev()
authorJian Dong <[email protected]>
Wed, 20 Jan 2021 01:47:12 +0000 (09:47 +0800)
committerSebastian Reichel <[email protected]>
Thu, 28 Jan 2021 00:31:42 +0000 (01:31 +0100)
Use kobj_to_dev() instead of open-coding it

Signed-off-by: Jian Dong <[email protected]>
Signed-off-by: Sebastian Reichel <[email protected]>
drivers/power/supply/ds2760_battery.c

index 695bb67474007406bff90e99d75eb37cfbde435e..5f50da524f418247d8af7406dfda2f6e78b4283c 100644 (file)
@@ -198,7 +198,7 @@ static ssize_t w1_slave_read(struct file *filp, struct kobject *kobj,
                             struct bin_attribute *bin_attr, char *buf,
                             loff_t off, size_t count)
 {
-       struct device *dev = container_of(kobj, struct device, kobj);
+       struct device *dev = kobj_to_dev(kobj);
        return w1_ds2760_read(dev, buf, off, count);
 }
 
This page took 0.052083 seconds and 4 git commands to generate.