Commit c211b6b9 authored by Lee Jones's avatar Lee Jones Committed by Samuel Ortiz

mfd: abx500-core: Convert to managed resources for allocating memory

Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
Signed-off-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
parent 99cd4b4d
...@@ -36,7 +36,9 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops) ...@@ -36,7 +36,9 @@ int abx500_register_ops(struct device *dev, struct abx500_ops *ops)
{ {
struct abx500_device_entry *dev_entry; 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) { if (!dev_entry) {
dev_err(dev, "register_ops kzalloc failed"); dev_err(dev, "register_ops kzalloc failed");
return -ENOMEM; return -ENOMEM;
...@@ -54,12 +56,8 @@ void abx500_remove_ops(struct device *dev) ...@@ -54,12 +56,8 @@ void abx500_remove_ops(struct device *dev)
struct abx500_device_entry *dev_entry, *tmp; struct abx500_device_entry *dev_entry, *tmp;
list_for_each_entry_safe(dev_entry, tmp, &abx500_list, list) 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); list_del(&dev_entry->list);
kfree(dev_entry);
}
}
} }
EXPORT_SYMBOL(abx500_remove_ops); EXPORT_SYMBOL(abx500_remove_ops);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment