Skip to content

Commit

Permalink
power_supply: ab8500: Use power_supply_*() API for accessing function…
Browse files Browse the repository at this point in the history
… 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 <k.kozlowski@samsung.com>
Acked-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
  • Loading branch information
Krzysztof Kozlowski authored and Sebastian Reichel committed Mar 13, 2015
1 parent 465c436 commit 15077fc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/power/ab8500_btemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ static int ab8500_btemp_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop;
prop = ext->properties[j];

if (ext->get_property(ext, prop, &ret))
if (power_supply_get_property(ext, prop, &ret))
continue;

switch (prop) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -1957,7 +1957,7 @@ static int ab8500_charger_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop;
prop = ext->properties[j];

if (ext->get_property(ext, prop, &ret))
if (power_supply_get_property(ext, prop, &ret))
continue;

switch (prop) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/power/ab8500_fg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ static int ab8500_fg_get_ext_psy_data(struct device *dev, void *data)
enum power_supply_property prop;
prop = ext->properties[j];

if (ext->get_property(ext, prop, &ret))
if (power_supply_get_property(ext, prop, &ret))
continue;

switch (prop) {
Expand Down
4 changes: 2 additions & 2 deletions drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
* property because of handling that sysfs entry on its own, this is
* the place to get the battery capacity.
*/
if (!ext->get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
if (!power_supply_get_property(ext, POWER_SUPPLY_PROP_CAPACITY, &ret)) {
di->batt_data.percent = ret.intval;
capacity_updated = true;
}
Expand All @@ -1019,7 +1019,7 @@ static int abx500_chargalg_get_ext_psy_data(struct device *dev, void *data)
ext->type == POWER_SUPPLY_TYPE_USB)
di->usb_chg = psy_to_ux500_charger(ext);

if (ext->get_property(ext, prop, &ret))
if (power_supply_get_property(ext, prop, &ret))
continue;
switch (prop) {
case POWER_SUPPLY_PROP_PRESENT:
Expand Down

0 comments on commit 15077fc

Please sign in to comment.