Skip to content

Commit d7bdffb

Browse files
krzksre
authored andcommitted
power_supply: bq2415x_charger: 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]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 75599d3 commit d7bdffb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/power/bq2415x_charger.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -809,7 +809,8 @@ static int bq2415x_notifier_call(struct notifier_block *nb,
809809

810810
dev_dbg(bq->dev, "notifier call was called\n");
811811

812-
ret = psy->get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX, &prop);
812+
ret = power_supply_get_property(psy, POWER_SUPPLY_PROP_CURRENT_MAX,
813+
&prop);
813814
if (ret != 0)
814815
return NOTIFY_OK;
815816

0 commit comments

Comments
 (0)