summaryrefslogtreecommitdiffstats
path: root/drivers/regulator/wm831x-isink.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-15 02:11:14 +0800
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-20 11:29:05 +0000
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 d3ad3f5cff4..634aac3f2d5 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)
if (pdata == NULL || pdata->isink[id] == NULL)
return -ENODEV;
- isink = kzalloc(sizeof(struct wm831x_isink), GFP_KERNEL);
+ isink = devm_kzalloc(&pdev->dev, sizeof(struct wm831x_isink),
+ GFP_KERNEL);
if (isink == NULL) {
dev_err(&pdev->dev, "Unable to allocate private data\n");
return -ENOMEM;
@@ -213,7 +214,6 @@ static __devinit int wm831x_isink_probe(struct platform_device *pdev)
err_regulator:
regulator_unregister(isink->regulator);
err:
- kfree(isink);
return ret;
}
@@ -226,7 +226,6 @@ static __devexit int wm831x_isink_remove(struct platform_device *pdev)
free_irq(platform_get_irq(pdev, 0), isink);
regulator_unregister(isink->regulator);
- kfree(isink);
return 0;
}