Commit b9e0348f authored by Mark Brown's avatar Mark Brown

regulator: wm8994: Convert to devm_kzalloc()

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent 46783a04
...@@ -241,7 +241,7 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev) ...@@ -241,7 +241,7 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
if (!pdata) if (!pdata)
return -ENODEV; return -ENODEV;
ldo = kzalloc(sizeof(struct wm8994_ldo), GFP_KERNEL); ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_ldo), GFP_KERNEL);
if (ldo == NULL) { if (ldo == NULL) {
dev_err(&pdev->dev, "Unable to allocate private data\n"); dev_err(&pdev->dev, "Unable to allocate private data\n");
return -ENOMEM; return -ENOMEM;
...@@ -285,7 +285,6 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev) ...@@ -285,7 +285,6 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
if (gpio_is_valid(ldo->enable)) if (gpio_is_valid(ldo->enable))
gpio_free(ldo->enable); gpio_free(ldo->enable);
err: err:
kfree(ldo);
return ret; return ret;
} }
...@@ -298,7 +297,6 @@ static __devexit int wm8994_ldo_remove(struct platform_device *pdev) ...@@ -298,7 +297,6 @@ static __devexit int wm8994_ldo_remove(struct platform_device *pdev)
regulator_unregister(ldo->regulator); regulator_unregister(ldo->regulator);
if (gpio_is_valid(ldo->enable)) if (gpio_is_valid(ldo->enable))
gpio_free(ldo->enable); gpio_free(ldo->enable);
kfree(ldo);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment