power_supply: max8998: Use devm_power_supply_register
authorVaishali Thakkar <vthakkar1994@gmail.com>
Thu, 13 Aug 2015 04:54:41 +0000 (10:24 +0530)
committerSebastian Reichel <sre@kernel.org>
Tue, 22 Sep 2015 14:20:10 +0000 (16:20 +0200)
commit5e5822f670c2c61953b5d4d18b4cc3e66744865c
tree48ab3f28eb14bf81bc4eb49446d90813c2aa4c3e
parent75ea8ca844fd35ce365e35e1617b239892d31f72
power_supply: max8998: Use devm_power_supply_register

Use managed resource function devm_power_supply_register instead
of power_supply_register to simplify the error path by allowing
unregister to happen automatically on error. To be compatible with
the change, replace various gotos by direct returns and remove
unneeded label err.

Also, remove max8998_battery_remove as it is now redundant.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/max8998_charger.c