提交 ea49a5eb 编写于 作者: A Axel Lin 提交者: Mark Brown

regulator: da9052: Convert to devm_regulator_register

Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 4e8d7935
......@@ -389,8 +389,9 @@ static int da9052_regulator_probe(struct platform_device *pdev)
#endif
}
regulator->rdev = regulator_register(&regulator->info->reg_desc,
&config);
regulator->rdev = devm_regulator_register(&pdev->dev,
&regulator->info->reg_desc,
&config);
if (IS_ERR(regulator->rdev)) {
dev_err(&pdev->dev, "failed to register regulator %s\n",
regulator->info->reg_desc.name);
......@@ -402,17 +403,8 @@ static int da9052_regulator_probe(struct platform_device *pdev)
return 0;
}
static int da9052_regulator_remove(struct platform_device *pdev)
{
struct da9052_regulator *regulator = platform_get_drvdata(pdev);
regulator_unregister(regulator->rdev);
return 0;
}
static struct platform_driver da9052_regulator_driver = {
.probe = da9052_regulator_probe,
.remove = da9052_regulator_remove,
.driver = {
.name = "da9052-regulator",
.owner = THIS_MODULE,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册