diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-15 02:11:14 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-12-20 11:29:05 +0000 |
commit | fded2f4faee7670b0545ac05bd2b3ed6b9afcda2 (patch) | |
tree | d9902d70c0e93366330e1b0aae7b88263e1fe4f6 /drivers/regulator/wm831x-isink.c | |
parent | 6242eae9bce864467bc4d6a8b67d1846ecaccf23 (diff) | |
download | lwn-fded2f4faee7670b0545ac05bd2b3ed6b9afcda2.tar.gz lwn-fded2f4faee7670b0545ac05bd2b3ed6b9afcda2.zip |
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.c | 5 |
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) 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; } |