From 0b7bb09054aebe66fd803c8f88015046b96cb47f Mon Sep 17 00:00:00 2001 From: Jingoo Han Date: Mon, 30 Sep 2013 09:55:51 +0900 Subject: [PATCH] regulator: lp8788-ldo: use devm_regulator_register() Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han Signed-off-by: Mark Brown --- drivers/regulator/lp8788-ldo.c | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/drivers/regulator/lp8788-ldo.c b/drivers/regulator/lp8788-ldo.c index 0527d87c6dd5..b9a29a29933f 100644 --- a/drivers/regulator/lp8788-ldo.c +++ b/drivers/regulator/lp8788-ldo.c @@ -543,7 +543,7 @@ static int lp8788_dldo_probe(struct platform_device *pdev) cfg.driver_data = ldo; cfg.regmap = lp->regmap; - rdev = regulator_register(&lp8788_dldo_desc[id], &cfg); + rdev = devm_regulator_register(&pdev->dev, &lp8788_dldo_desc[id], &cfg); if (IS_ERR(rdev)) { ret = PTR_ERR(rdev); dev_err(&pdev->dev, "DLDO%d regulator register err = %d\n", @@ -557,18 +557,8 @@ static int lp8788_dldo_probe(struct platform_device *pdev) return 0; } -static int lp8788_dldo_remove(struct platform_device *pdev) -{ - struct lp8788_ldo *ldo = platform_get_drvdata(pdev); - - regulator_unregister(ldo->regulator); - - return 0; -} - static struct platform_driver lp8788_dldo_driver = { .probe = lp8788_dldo_probe, - .remove = lp8788_dldo_remove, .driver = { .name = LP8788_DEV_DLDO, .owner = THIS_MODULE, @@ -603,7 +593,7 @@ static int lp8788_aldo_probe(struct platform_device *pdev) cfg.driver_data = ldo; cfg.regmap = lp->regmap; - rdev = regulator_register(&lp8788_aldo_desc[id], &cfg); + rdev = devm_regulator_register(&pdev->dev, &lp8788_aldo_desc[id], &cfg); if (IS_ERR(rdev)) { ret = PTR_ERR(rdev); dev_err(&pdev->dev, "ALDO%d regulator register err = %d\n", @@ -617,18 +607,8 @@ static int lp8788_aldo_probe(struct platform_device *pdev) return 0; } -static int lp8788_aldo_remove(struct platform_device *pdev) -{ - struct lp8788_ldo *ldo = platform_get_drvdata(pdev); - - regulator_unregister(ldo->regulator); - - return 0; -} - static struct platform_driver lp8788_aldo_driver = { .probe = lp8788_aldo_probe, - .remove = lp8788_aldo_remove, .driver = { .name = LP8788_DEV_ALDO, .owner = THIS_MODULE, -- 2.39.5