Skip to content

Commit 091e73a

Browse files
krzksre
authored andcommitted
mfd: ab8500: Use power_supply_*() API for accessing function attrs
Replace direct calls to power supply function attributes with wrappers. Wrappers provide safe access in case of unregistering the power supply (e.g. by removing the driver). Replace: - get_property -> power_supply_get_property Signed-off-by: Krzysztof Kozlowski <[email protected]> Acked-by: Jonghwa Lee <[email protected]> Acked-by: Pavel Machek <[email protected]> Acked-by: Lee Jones <[email protected]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 15077fc commit 091e73a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mfd/ab8500-sysctrl.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ static void ab8500_power_off(void)
4949
if (!psy)
5050
continue;
5151

52-
ret = psy->get_property(psy, POWER_SUPPLY_PROP_ONLINE, &val);
52+
ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_ONLINE,
53+
&val);
5354

5455
if (!ret && val.intval) {
5556
charger_present = true;
@@ -63,8 +64,8 @@ static void ab8500_power_off(void)
6364
/* Check if battery is known */
6465
psy = power_supply_get_by_name("ab8500_btemp");
6566
if (psy) {
66-
ret = psy->get_property(psy, POWER_SUPPLY_PROP_TECHNOLOGY,
67-
&val);
67+
ret = power_supply_get_property(psy,
68+
POWER_SUPPLY_PROP_TECHNOLOGY, &val);
6869
if (!ret && val.intval != POWER_SUPPLY_TECHNOLOGY_UNKNOWN) {
6970
printk(KERN_INFO
7071
"Charger \"%s\" is connected with known battery."

0 commit comments

Comments
 (0)