regulator: ab3100: use devm_regulator_register()
authorJingoo Han <jg1.han@samsung.com>
Mon, 30 Sep 2013 00:50:14 +0000 (09:50 +0900)
committerMark Brown <broonie@linaro.org>
Mon, 30 Sep 2013 17:10:52 +0000 (18:10 +0100)
Use devm_regulator_register() to make cleanup paths simpler.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/ab3100.c

index 7d5eaa874b2da9337e387b1271bd2e38a3d25d2e..77b46d0b37a604fa31f7b90fb270d8ac59023e0c 100644 (file)
@@ -535,7 +535,7 @@ static int ab3100_regulator_register(struct platform_device *pdev,
        config.dev = &pdev->dev;
        config.driver_data = reg;
 
-       rdev = regulator_register(desc, &config);
+       rdev = devm_regulator_register(&pdev->dev, desc, &config);
        if (IS_ERR(rdev)) {
                err = PTR_ERR(rdev);
                dev_err(&pdev->dev,
@@ -616,7 +616,6 @@ static int ab3100_regulators_remove(struct platform_device *pdev)
        for (i = 0; i < AB3100_NUM_REGULATORS; i++) {
                struct ab3100_regulator *reg = &ab3100_regulators[i];
 
-               regulator_unregister(reg->rdev);
                reg->rdev = NULL;
        }
        return 0;