Commit 224941c9 authored by Wang Qing's avatar Wang Qing Committed by Sebastian Reichel
Browse files

power: supply: use kobj_to_dev



Use kobj_to_dev() API instead of open-coded container_of().

Signed-off-by: default avatarWang Qing <wangqing@vivo.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 0768e6e4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;