aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-isink.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-14 13:11:14 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 06:29:05 -0500
commitfded2f4faee7670b0545ac05bd2b3ed6b9afcda2 (patch)
treed9902d70c0e93366330e1b0aae7b88263e1fe4f6 /drivers/regulator/wm831x-isink.c
parent6242eae9bce864467bc4d6a8b67d1846ecaccf23 (diff)
regulator: Convert wm831x regulator drivers to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/wm831x-isink.c')
-rw-r--r--drivers/regulator/wm831x-isink.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/wm831x-isink.c b/drivers/regulator/wm831x-isink.c
index d3ad3f5cff46..634aac3f2d5f 100644
--- a/drivers/regulator/wm831x-isink.c
+++ b/drivers/regulator/wm831x-isink.c
@@ -162,7 +162,8 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
162 if (pdata == NULL || pdata->isink[id] == NULL) 162 if (pdata == NULL || pdata->isink[id] == NULL)
163 return -ENODEV; 163 return -ENODEV;
164 164
165 isink = kzalloc(sizeof(struct wm831x_isink), GFP_KERNEL); 165 isink = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_isink),
166 GFP_KERNEL);
166 if (isink == NULL) { 167 if (isink == NULL) {
167 dev_err(&pdev->dev, "Unable to allocate private data\n"); 168 dev_err(&pdev->dev, "Unable to allocate private data\n");
168 return -ENOMEM; 169 return -ENOMEM;
@@ -213,7 +214,6 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
213err_regulator: 214err_regulator:
214 regulator_unregister(isink->regulator); 215 regulator_unregister(isink->regulator);
215err: 216err:
216 kfree(isink);
217 return ret; 217 return ret;
218} 218}
219 219
@@ -226,7 +226,6 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev)
226 free_irq(platform_get_irq(pdev, 0), isink); 226 free_irq(platform_get_irq(pdev, 0), isink);
227 227
228 regulator_unregister(isink->regulator); 228 regulator_unregister(isink->regulator);
229 kfree(isink);
230 229
231 return 0; 230 return 0;
232} 231}