Skip to content

Commit

Permalink
regulator: wm8994: Convert to devm_kzalloc()
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Mark Brown committed Mar 11, 2012
1 parent 46783a0 commit b9e0348
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/regulator/wm8994-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
if (!pdata)
return -ENODEV;

ldo = kzalloc(sizeof(struct wm8994_ldo), GFP_KERNEL);
ldo = devm_kzalloc(&pdev->dev, sizeof(struct wm8994_ldo), GFP_KERNEL);
if (ldo == NULL) {
dev_err(&pdev->dev, "Unable to allocate private data\n");
return -ENOMEM;
Expand Down Expand Up @@ -285,7 +285,6 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
if (gpio_is_valid(ldo->enable))
gpio_free(ldo->enable);
err:
kfree(ldo);
return ret;
}

Expand All @@ -298,7 +297,6 @@ static __devexit int wm8994_ldo_remove(struct platform_device *pdev)
regulator_unregister(ldo->regulator);
if (gpio_is_valid(ldo->enable))
gpio_free(ldo->enable);
kfree(ldo);

return 0;
}
Expand Down

0 comments on commit b9e0348

Please sign in to comment.