Skip to content

Commit 15077fc

Browse files
krzksre
authored andcommitted
power_supply: 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: Linus Walleij <[email protected]> Reviewed-by: Bartlomiej Zolnierkiewicz <[email protected]> Reviewed-by: Sebastian Reichel <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 465c436 commit 15077fc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

drivers/power/ab8500_btemp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
938938
enum power_supply_property prop;
939939
prop = ext->properties[j];
940940

941-
if (ext->get_property(ext, prop, &ret))
941+
if (power_supply_get_property(ext, prop, &ret))
942942
continue;
943943

944944
switch (prop) {

drivers/power/ab8500_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1957,7 +1957,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data)
19571957
enum power_supply_property prop;
19581958
prop = ext->properties[j];
19591959

1960-
if (ext->get_property(ext, prop, &ret))
1960+
if (power_supply_get_property(ext, prop, &ret))
19611961
continue;
19621962

19631963
switch (prop) {

drivers/power/ab8500_fg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2200,7 +2200,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
22002200
enum power_supply_property prop;
22012201
prop = ext->properties[j];
22022202

2203-
if (ext->get_property(ext, prop, &ret))
2203+
if (power_supply_get_property(ext, prop, &ret))
22042204
continue;
22052205

22062206
switch (prop) {

drivers/power/abx500_chargalg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
10011001
* property because of handling that sysfs entry on its own, this is
10021002
* the place to get the battery capacity.
10031003
*/
1004-
if (!ext->get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
1004+
if (!power_supply_get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
10051005
di->batt_data.percent = ret.intval;
10061006
capacity_updated = true;
10071007
}
@@ -1019,7 +1019,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
10191019
ext->type == POWER_SUPPLY_TYPE_USB)
10201020
di->usb_chg = psy_to_ux500_charger(ext);
10211021

1022-
if (ext->get_property(ext, prop, &ret))
1022+
if (power_supply_get_property(ext, prop, &ret))
10231023
continue;
10241024
switch (prop) {
10251025
case POWER_SUPPLY_PROP_PRESENT:

0 commit comments

Comments
 (0)