regulator: arizona-ldo1: Convert to devm_regulator_register()
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 10:56:47 +0000 (11:56 +0100)
committerMark Brown <broonie@linaro.org>
Mon, 16 Sep 2013 23:27:54 +0000 (00:27 +0100)
Signed-off-by: Mark Brown <broonie@linaro.org>
drivers/regulator/arizona-ldo1.c

index 81d8681c31959557fa78a7121d64e85c957e719b..4f6c2055f6b210436a5c1a9565b9f302ecdd21da 100644 (file)
@@ -226,7 +226,7 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
        else
                config.init_data = &ldo1->init_data;
 
-       ldo1->regulator = regulator_register(desc, &config);
+       ldo1->regulator = devm_regulator_register(&pdev->dev, desc, &config);
        if (IS_ERR(ldo1->regulator)) {
                ret = PTR_ERR(ldo1->regulator);
                dev_err(arizona->dev, "Failed to register LDO1 supply: %d\n",
@@ -239,18 +239,8 @@ static int arizona_ldo1_probe(struct platform_device *pdev)
        return 0;
 }
 
-static int arizona_ldo1_remove(struct platform_device *pdev)
-{
-       struct arizona_ldo1 *ldo1 = platform_get_drvdata(pdev);
-
-       regulator_unregister(ldo1->regulator);
-
-       return 0;
-}
-
 static struct platform_driver arizona_ldo1_driver = {
        .probe = arizona_ldo1_probe,
-       .remove = arizona_ldo1_remove,
        .driver         = {
                .name   = "arizona-ldo1",
                .owner  = THIS_MODULE,