mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-11 00:45:13 +00:00
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>
This commit is contained in:
parent
32c78de8f1
commit
cbe10a3674
1 changed files with 1 additions and 4 deletions
|
|
@ -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);
|
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]),
|
pdata->num_regulators * sizeof(priv->regulators[0]),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!priv)
|
if (!priv)
|
||||||
|
|
@ -374,8 +374,6 @@ err:
|
||||||
while (--i >= 0)
|
while (--i >= 0)
|
||||||
regulator_unregister(priv->regulators[i]);
|
regulator_unregister(priv->regulators[i]);
|
||||||
|
|
||||||
kfree(priv);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -391,7 +389,6 @@ static int __devexit mc13783_regulator_remove(struct platform_device *pdev)
|
||||||
for (i = 0; i < pdata->num_regulators; i++)
|
for (i = 0; i < pdata->num_regulators; i++)
|
||||||
regulator_unregister(priv->regulators[i]);
|
regulator_unregister(priv->regulators[i]);
|
||||||
|
|
||||||
kfree(priv);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue