提交 4fef21ea 编写于 作者: F Fabio Estevam 提交者: Mark Brown

regulator: mc13892: Convert to devm_kzalloc()

Convert mc13892-regulator driver to use devm_kzalloc().
Signed-off-by: NFabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
上级 cbe10a36
......@@ -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 @@ static int __devinit mc13892_regulator_probe(struct platform_device *pdev)
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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册