diff mbox series

drivers\power\supply: use kobj_to_dev

Message ID 1591944954-14411-1-git-send-email-wangqing@vivo.com
State Accepted
Commit 224941c9424fd840bd54d2df8dbe84d1e4aa35af
Headers show
Series drivers\power\supply: use kobj_to_dev | expand

Commit Message

Qing Wang June 12, 2020, 6:55 a.m. UTC
Use kobj_to_dev() API instead of container_of().

Signed-off-by: Wang Qing <wangqing@vivo.com>
---
 drivers/power/supply/power_supply_sysfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 mode change 100644 => 100755 drivers/power/supply/power_supply_sysfs.c
diff mbox series

Patch

diff --git a/drivers/power/supply/power_supply_sysfs.c b/drivers/power/supply/power_supply_sysfs.c
index bc79560..af0cad2
--- 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;