diff options
author | Wang Qing <wangqing@vivo.com> | 2020-06-12 09:55:54 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2020-06-19 17:55:48 +0300 |
commit | 224941c9424fd840bd54d2df8dbe84d1e4aa35af (patch) | |
tree | dd7d05d53302bb07e1d9f9b64c92fd048ec7c544 /drivers | |
parent | 0768e6e4934e239f1a7f8ba83150a7c46765bb3e (diff) | |
download | linux-224941c9424fd840bd54d2df8dbe84d1e4aa35af.tar.xz |
power: supply: use kobj_to_dev
Use kobj_to_dev() API instead of open-coded container_of().
Signed-off-by: Wang Qing <wangqing@vivo.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/supply/power_supply_sysfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c index bc79560229b5..af0cad253f52 100644 --- a/drivers/power/supply/power_supply_sysfs.c +++ b/drivers/power/supply/power_supply_sysfs.c @@ -343,7 +343,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj, struct attribute *attr, int attrno) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct power_supply *psy = dev_get_drvdata(dev); umode_t mode = S_IRUSR | S_IRGRP | S_IROTH; int i; |