summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2011-12-29 13:56:02 -0200
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-12-29 17:58:37 +0000
commitcbe10a3674ba1cfa227d0d4e990353bada85fa09 (patch)
tree600adc344ac0abef5768235b48111dbb52eb4feb /drivers/regulator
parent32c78de8f17369def492ea3ddd785f0cc140af02 (diff)
regulator: mc13783: Convert to devm_kzalloc()
Convert mc13783-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/mc13783-regulator.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c
index 56d4a677c40..8e9b90ad88a 100644
--- a/drivers/regulator/mc13783-regulator.c
+++ b/drivers/regulator/mc13783-regulator.c
@@ -344,7 +344,7 @@ static int __devinit mc13783_regulator_probe(struct platform_device *pdev)
dev_dbg(&pdev->dev, "%s id %d\n", __func__, pdev->id);
- priv = kzalloc(sizeof(*priv) +
+ priv = devm_kzalloc(&pdev->dev, sizeof(*priv) +
pdata->num_regulators * sizeof(priv->regulators[0]),
GFP_KERNEL);
if (!priv)
@@ -374,8 +374,6 @@ err:
while (--i >= 0)
regulator_unregister(priv->regulators[i]);
- kfree(priv);
-
return ret;
}
@@ -391,7 +389,6 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
for (i = 0; i < pdata->num_regulators; i++)
regulator_unregister(priv->regulators[i]);
- kfree(priv);
return 0;
}