summaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-12-29 20:05:00 -0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-30 02:06:29 +0000
commit4fef21eaacb9d739f0120c930c78dac4f6875b9f (patch)
tree278968f2e1c4aa1d99072822dc3023e378f5ba7c /drivers/regulator
parentcbe10a3674ba1cfa227d0d4e990353bada85fa09 (diff)
downloadop-kernel-dev-4fef21eaacb9d739f0120c930c78dac4f6875b9f.zip
op-kernel-dev-4fef21eaacb9d739f0120c930c78dac4f6875b9f.tar.gz
regulator: mc13892: Convert to devm_kzalloc()
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>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/mc13892-regulator.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/regulator/mc13892-regulator.c b/drivers/regulator/mc13892-regulator.c
index 46bfa4a..e8cfc99 100644
--- a/drivers/regulator/mc13892-regulator.c
+++ b/drivers/regulator/mc13892-regulator.c
@@ -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)
@@ -615,7 +615,6 @@ err:
err_free:
mc13xxx_unlock(mc13892);
- kfree(priv);
return ret;
}
@@ -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;
}
OpenPOWER on IntegriCloud