summaryrefslogtreecommitdiff
path: root/drivers/power/max8925_power.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-03-11 15:31:39 +0900
committerAnton Vorontsov <anton@enomsg.org>2013-03-31 23:25:53 -0700
commitfeeb3a92b1f4e4b53bbad2b1c0d0eb1bcdd6d5a7 (patch)
tree64f29d479e2994254abe155ed6111ed355462707 /drivers/power/max8925_power.c
parentbc67ea8e92d45d1237e289fd1c1ec004a8383ccc (diff)
downloadlwn-feeb3a92b1f4e4b53bbad2b1c0d0eb1bcdd6d5a7.tar.gz
lwn-feeb3a92b1f4e4b53bbad2b1c0d0eb1bcdd6d5a7.zip
max8925_power: 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/max8925_power.c')
-rw-r--r--drivers/power/max8925_power.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/power/max8925_power.c b/drivers/power/max8925_power.c
index 665cdc76c265..0ee1e14f76e9 100644
--- a/drivers/power/max8925_power.c
+++ b/drivers/power/max8925_power.c
@@ -489,7 +489,8 @@ static int max8925_power_probe(struct platform_device *pdev)
return -EINVAL;
}
- info = kzalloc(sizeof(struct max8925_power_info), GFP_KERNEL);
+ info = devm_kzalloc(&pdev->dev, sizeof(struct max8925_power_info),
+ GFP_KERNEL);
if (!info)
return -ENOMEM;
info->chip = chip;
@@ -546,7 +547,6 @@ out_battery:
out_usb:
power_supply_unregister(&info->ac);
out:
- kfree(info);
return ret;
}
@@ -559,7 +559,6 @@ static int max8925_power_remove(struct platform_device *pdev)
power_supply_unregister(&info->usb);
power_supply_unregister(&info->battery);
max8925_deinit_charger(info);
- kfree(info);
}
return 0;
}