diff options
author | Lee Jones <lee.jones@linaro.org> | 2013-05-23 16:25:06 +0100 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2013-06-13 12:11:40 +0200 |
commit | 99cd4b4d5f4f0fa3678b2a4a89b345f2ec1de305 (patch) | |
tree | 1b329eb70a3fc8dffedf80af21b62cc36abb29c9 /drivers/mfd/ab8500-gpadc.c | |
parent | c18cf6d1b0d871745709e4273dc2dfa05376d13b (diff) |
mfd: ab8500-gpadc: 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/ab8500-gpadc.c')
-rw-r--r-- | drivers/mfd/ab8500-gpadc.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/mfd/ab8500-gpadc.c b/drivers/mfd/ab8500-gpadc.c index 13f7866de46e..f1d4565e6fb4 100644 --- a/drivers/mfd/ab8500-gpadc.c +++ b/drivers/mfd/ab8500-gpadc.c @@ -925,7 +925,7 @@ static int ab8500_gpadc_probe(struct platform_device *pdev) int ret = 0; struct ab8500_gpadc *gpadc; - gpadc = kzalloc(sizeof(struct ab8500_gpadc), GFP_KERNEL); + gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL); if (!gpadc) { dev_err(&pdev->dev, "Error: No memory\n"); return -ENOMEM; @@ -1005,8 +1005,6 @@ fail_irq: free_irq(gpadc->irq_sw, gpadc); free_irq(gpadc->irq_hw, gpadc); fail: - kfree(gpadc); - gpadc = NULL; return ret; } @@ -1031,8 +1029,6 @@ static int ab8500_gpadc_remove(struct platform_device *pdev) pm_runtime_put_noidle(gpadc->dev); - kfree(gpadc); - gpadc = NULL; return 0; } |