Skip to content

Commit 224941c

Browse files
Wang Qingsre
authored andcommitted
power: supply: use kobj_to_dev
Use kobj_to_dev() API instead of open-coded container_of(). Signed-off-by: Wang Qing <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 0768e6e commit 224941c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/power/supply/power_supply_sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ static umode_t power_supply_attr_is_visible(struct kobject *kobj,
343343
struct attribute *attr,
344344
int attrno)
345345
{
346-
struct device *dev = container_of(kobj, struct device, kobj);
346+
struct device *dev = kobj_to_dev(kobj);
347347
struct power_supply *psy = dev_get_drvdata(dev);
348348
umode_t mode = S_IRUSR | S_IRGRP | S_IROTH;
349349
int i;

0 commit comments

Comments
 (0)