]> git.karo-electronics.de Git - linux-beck.git/commitdiff
regulator: s5m8767: Covert to devm_regulator_register()
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 10:57:34 +0000 (11:57 +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>
Acked-by: Sangbeom Kim <sbkim73@samsung.com>
drivers/regulator/s5m8767.c

index c24448bc43cfb71658d88afea9779e2b47471495..2297fdf9ba7e6353fac764efe32c56c48c68ea8a 100644 (file)
@@ -910,33 +910,16 @@ static int s5m8767_pmic_probe(struct platform_device *pdev)
                config.regmap = iodev->regmap;
                config.of_node = pdata->regulators[i].reg_node;
 
-               rdev[i] = regulator_register(&regulators[id], &config);
+               rdev[i] = devm_regulator_register(&pdev->dev, &regulators[id],
+                                                 &config);
                if (IS_ERR(rdev[i])) {
                        ret = PTR_ERR(rdev[i]);
                        dev_err(s5m8767->dev, "regulator init failed for %d\n",
                                        id);
-                       rdev[i] = NULL;
-                       goto err;
+                       return ret;
                }
        }
 
-       return 0;
-err:
-       for (i = 0; i < s5m8767->num_regulators; i++)
-               regulator_unregister(rdev[i]);
-
-       return ret;
-}
-
-static int s5m8767_pmic_remove(struct platform_device *pdev)
-{
-       struct s5m8767_info *s5m8767 = platform_get_drvdata(pdev);
-       struct regulator_dev **rdev = s5m8767->rdev;
-       int i;
-
-       for (i = 0; i < s5m8767->num_regulators; i++)
-               regulator_unregister(rdev[i]);
-
        return 0;
 }
 
@@ -952,7 +935,6 @@ static struct platform_driver s5m8767_pmic_driver = {
                .owner = THIS_MODULE,
        },
        .probe = s5m8767_pmic_probe,
-       .remove = s5m8767_pmic_remove,
        .id_table = s5m8767_pmic_id,
 };