summaryrefslogtreecommitdiffstats
path: root/drivers/mfd/abx500-core.c
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-23 16:25:07 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 12:11:41 +0200
commitc211b6b9c0144a531f08f0f975b45ecee895ae50 (patch)
tree750e2c4fe4373e33b10dc4d0819b572e67fa979f /drivers/mfd/abx500-core.c
parent99cd4b4d5f4f0fa3678b2a4a89b345f2ec1de305 (diff)
downloadop-kernel-dev-c211b6b9c0144a531f08f0f975b45ecee895ae50.zip
op-kernel-dev-c211b6b9c0144a531f08f0f975b45ecee895ae50.tar.gz
mfd: abx500-core: Convert to managed resources for allocating memory
Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/mfd/abx500-core.c')
-rw-r--r--drivers/mfd/abx500-core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/mfd/abx500-core.c b/drivers/mfd/abx500-core.c
index 3714acb..f3a15aa 100644
--- a/drivers/mfd/abx500-core.c
+++ b/drivers/mfd/abx500-core.c
@@ -36,7 +36,9 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
{
struct abx500_device_entry *dev_entry;
- dev_entry = kzalloc(sizeof(struct abx500_device_entry), GFP_KERNEL);
+ dev_entry = devm_kzalloc(dev,
+ sizeof(struct abx500_device_entry),
+ GFP_KERNEL);
if (!dev_entry) {
dev_err(dev, "register_ops kzalloc failed");
return -ENOMEM;
@@ -54,12 +56,8 @@ void abx500_remove_ops(struct device *dev)
struct abx500_device_entry *dev_entry, *tmp;
list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list)
- {
- if (dev_entry->dev == dev) {
+ if (dev_entry->dev == dev)
list_del(&dev_entry->list);
- kfree(dev_entry);
- }
- }
}
EXPORT_SYMBOL(abx500_remove_ops);
OpenPOWER on IntegriCloud