Signed-off-by: Axel Lin <axel....@ingics.com>
---
 drivers/regulator/da9052-regulator.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/regulator/da9052-regulator.c 
b/drivers/regulator/da9052-regulator.c
index 96b569a..25d3e47 100644
--- a/drivers/regulator/da9052-regulator.c
+++ b/drivers/regulator/da9052-regulator.c
@@ -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,
-- 
1.8.1.2



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to