summaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
authorPhil Reid <preid@electromag.com.au>2016-07-25 10:42:59 +0800
committerSebastian Reichel <sre@kernel.org>2016-08-15 21:51:30 +0200
commit492ff9d8f5fa6ad44288050238b7961d457a239d (patch)
treedf979bc455dda22583c20d72d7d82d46d732ea89 /drivers/power
parentd2cec82c28802da31596b395ad292cb8f132fd63 (diff)
downloadlinux-492ff9d8f5fa6ad44288050238b7961d457a239d.tar.bz2
power: sbs-battery: Use devm_power_supply_register
Use devm_power_supply_register instead of power_supply_register. Remove call to power_supply_unregister. Signed-off-by: Phil Reid <preid@electromag.com.au> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/supply/sbs-battery.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index f9012ed29f47..31f3e333b950 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -894,7 +894,7 @@ skip_gpio:
}
}
- chip->power_supply = power_supply_register(&client->dev, sbs_desc,
+ chip->power_supply = devm_power_supply_register(&client->dev, sbs_desc,
&psy_cfg);
if (IS_ERR(chip->power_supply)) {
dev_err(&client->dev,
@@ -926,8 +926,6 @@ static int sbs_remove(struct i2c_client *client)
if (chip->gpio_detect)
gpio_free(chip->pdata->battery_detect);
- power_supply_unregister(chip->power_supply);
-
cancel_delayed_work_sync(&chip->work);
return 0;