aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Jones <lee.jones@linaro.org>2013-05-23 11:25:06 -0400
committerSamuel Ortiz <sameo@linux.intel.com>2013-06-13 06:11:40 -0400
commit99cd4b4d5f4f0fa3678b2a4a89b345f2ec1de305 (patch)
tree1b329eb70a3fc8dffedf80af21b62cc36abb29c9
parentc18cf6d1b0d871745709e4273dc2dfa05376d13b (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>
-rw-r--r--drivers/mfd/ab8500-gpadc.c6
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)
925 int ret = 0; 925 int ret = 0;
926 struct ab8500_gpadc *gpadc; 926 struct ab8500_gpadc *gpadc;
927 927
928 gpadc = kzalloc(sizeof(struct ab8500_gpadc), GFP_KERNEL); 928 gpadc = devm_kzalloc(&pdev->dev, sizeof(struct ab8500_gpadc), GFP_KERNEL);
929 if (!gpadc) { 929 if (!gpadc) {
930 dev_err(&pdev->dev, "Error: No memory\n"); 930 dev_err(&pdev->dev, "Error: No memory\n");
931 return -ENOMEM; 931 return -ENOMEM;
@@ -1005,8 +1005,6 @@ fail_irq:
1005 free_irq(gpadc->irq_sw, gpadc); 1005 free_irq(gpadc->irq_sw, gpadc);
1006 free_irq(gpadc->irq_hw, gpadc); 1006 free_irq(gpadc->irq_hw, gpadc);
1007fail: 1007fail:
1008 kfree(gpadc);
1009 gpadc = NULL;
1010 return ret; 1008 return ret;
1011} 1009}
1012 1010
@@ -1031,8 +1029,6 @@ static int ab8500_gpadc_remove(struct platform_device *pdev)
1031 1029
1032 pm_runtime_put_noidle(gpadc->dev); 1030 pm_runtime_put_noidle(gpadc->dev);
1033 1031
1034 kfree(gpadc);
1035 gpadc = NULL;
1036 return 0; 1032 return 0;
1037} 1033}
1038 1034