提交 00ce070e 编写于 作者: J Jingoo Han 提交者: Mark Brown

regulator: twl: use devm_regulator_register()

Use devm_regulator_register() to make cleanup paths simpler.
Signed-off-by: NJingoo Han <jg1.han@samsung.com>
Acked-by: NNishanth Menon <nm@ti.com>
Signed-off-by: NMark Brown <broonie@linaro.org>
上级 6a2b5a93
...@@ -1188,7 +1188,7 @@ static int twlreg_probe(struct platform_device *pdev) ...@@ -1188,7 +1188,7 @@ static int twlreg_probe(struct platform_device *pdev)
config.driver_data = info; config.driver_data = info;
config.of_node = pdev->dev.of_node; config.of_node = pdev->dev.of_node;
rdev = regulator_register(&info->desc, &config); rdev = devm_regulator_register(&pdev->dev, &info->desc, &config);
if (IS_ERR(rdev)) { if (IS_ERR(rdev)) {
dev_err(&pdev->dev, "can't register %s, %ld\n", dev_err(&pdev->dev, "can't register %s, %ld\n",
info->desc.name, PTR_ERR(rdev)); info->desc.name, PTR_ERR(rdev));
...@@ -1217,7 +1217,6 @@ static int twlreg_remove(struct platform_device *pdev) ...@@ -1217,7 +1217,6 @@ static int twlreg_remove(struct platform_device *pdev)
struct regulator_dev *rdev = platform_get_drvdata(pdev); struct regulator_dev *rdev = platform_get_drvdata(pdev);
struct twlreg_info *info = rdev->reg_data; struct twlreg_info *info = rdev->reg_data;
regulator_unregister(rdev);
kfree(info); kfree(info);
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册