Skip to content

Commit

Permalink
regulator: mc13892: Convert to devm_kzalloc()
Browse files Browse the repository at this point in the history
Convert mc13892-regulator driver to use devm_kzalloc().

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Fabio Estevam authored and Mark Brown committed Dec 30, 2011
1 parent cbe10a3 commit 4fef21e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions drivers/regulator/mc13892-regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
if (num_regulators <= 0)
return -EINVAL;

priv = kzalloc(sizeof(*priv) +
priv = devm_kzalloc(&pdev->dev, sizeof(*priv) +
num_regulators * sizeof(priv->regulators[0]),
GFP_KERNEL);
if (!priv)
Expand Down Expand Up @@ -615,7 +615,6 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)

err_free:
mc13xxx_unlock(mc13892);
kfree(priv);

return ret;
}
Expand All @@ -630,7 +629,6 @@ static int __devexit mc13892_regulator_remove(struct platform_device *pdev)
for (i = 0; i < priv->num_regulators; i++)
regulator_unregister(priv->regulators[i]);

kfree(priv);
return 0;
}

Expand Down

0 comments on commit 4fef21e

Please sign in to comment.