summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-23 17:25:14 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 12:11:44 +0200
commit8692881e38644383398affaa68fcabc0299a4d7f (patch)
treee7e1823f30574aa8f483d10ff378ddaf4327c1ec
parentmfd: htc-i2cpld: Convert to managed resources for allocating memory (diff)
downloadlinux-8692881e38644383398affaa68fcabc0299a4d7f.tar.xz
linux-8692881e38644383398affaa68fcabc0299a4d7f.zip
mfd: htc-pasic3: 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>
-rw-r--r--drivers/mfd/htc-pasic3.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 0285fceb99a6..0a5e85fd8517 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -147,7 +147,7 @@ static int __init pasic3_probe(struct platform_device *pdev)
if (!request_mem_region(r->start, resource_size(r), "pasic3"))
return -EBUSY;
- asic = kzalloc(sizeof(struct pasic3_data), GFP_KERNEL);
+ asic = devm_kzalloc(dev, sizeof(struct pasic3_data), GFP_KERNEL);
if (!asic)
return -ENOMEM;
@@ -156,7 +156,6 @@ static int __init pasic3_probe(struct platform_device *pdev)
asic->mapping = ioremap(r->start, resource_size(r));
if (!asic->mapping) {
dev_err(dev, "couldn't ioremap PASIC3\n");
- kfree(asic);
return -ENOMEM;
}
@@ -195,7 +194,6 @@ static int pasic3_remove(struct platform_device *pdev)
iounmap(asic->mapping);
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
release_mem_region(r->start, resource_size(r));
- kfree(asic);
return 0;
}