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>
This commit is contained in:
parent
0768e6e493
commit
224941c942
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue