summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorWang Qing <wangqing@vivo.com>2020-06-12 08:55:54 +0200
committerSebastian Reichel <sre@kernel.org>2020-06-19 16:55:48 +0200
commit224941c9424fd840bd54d2df8dbe84d1e4aa35af (patch)
treedd7d05d53302bb07e1d9f9b64c92fd048ec7c544 /drivers/power
parentdt-bindings: power: supply: bq25890: Document required interrupt (diff)
downloadlinux-224941c9424fd840bd54d2df8dbe84d1e4aa35af.tar.xz
linux-224941c9424fd840bd54d2df8dbe84d1e4aa35af.zip
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/power')
-rw-r--r--drivers/power/supply/power_supply_sysfs.c2
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;