aboutsummaryrefslogtreecommitdiff
path: root/drivers/power
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-03-11 15:34:15 +0900
committerAnton Vorontsov <anton@enomsg.org>2013-03-31 23:25:40 -0700
commit2a2ce52a4006db6c7831f1b21f1b0cc892516e85 (patch)
tree2df617181f1d2fe797c2bb94b7b35866f723c1d9 /drivers/power
parentf3f66b3ea46237a0810d09279a38b5413aaf5d5e (diff)
downloadlinaro-lsk-2a2ce52a4006db6c7831f1b21f1b0cc892516e85.tar.gz
isp1704_charger: Use devm_kzalloc()
Use devm_kzalloc() to make cleanup paths more simple. Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/isp1704_charger.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c
index 176ad59d99f..fc04d191579 100644
--- a/drivers/power/isp1704_charger.c
+++ b/drivers/power/isp1704_charger.c
@@ -411,7 +411,7 @@ static int isp1704_charger_probe(struct platform_device *pdev)
struct isp1704_charger *isp;
int ret = -ENODEV;
- isp = kzalloc(sizeof *isp, GFP_KERNEL);
+ isp = devm_kzalloc(&pdev->dev, sizeof(*isp), GFP_KERNEL);
if (!isp)
return -ENOMEM;
@@ -477,8 +477,6 @@ fail1:
isp1704_charger_set_power(isp, 0);
usb_put_phy(isp->phy);
fail0:
- kfree(isp);
-
dev_err(&pdev->dev, "failed to register isp1704 with error %d\n", ret);
return ret;
@@ -492,7 +490,6 @@ static int isp1704_charger_remove(struct platform_device *pdev)
power_supply_unregister(&isp->psy);
usb_put_phy(isp->phy);
isp1704_charger_set_power(isp, 0);
- kfree(isp);
return 0;
}