forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
d2cec82c28
commit
492ff9d8f5
|
@ -894,7 +894,7 @@ static int sbs_probe(struct i2c_client *client,
|
|||
}
|
||||
}
|
||||
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user