regulator: s2mps11: Convert to devm_regulator_register()
authorMark Brown <broonie@linaro.org>
Sat, 31 Aug 2013 10:57:16 +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/s2mps11.c

index 5eba2ff8c0e86eff58bf5c48e77e4ad352f8b00a..d7c241e1a17336171f661345e37a0e5f553e8acd 100644 (file)
@@ -453,27 +453,10 @@ common_reg:
                        ret = PTR_ERR(s2mps11->rdev[i]);
                        dev_err(&pdev->dev, "regulator init failed for %d\n",
                                i);
-                       s2mps11->rdev[i] = NULL;
-                       goto err;
+                       return ret;
                }
        }
 
-       return 0;
-err:
-       for (i = 0; i < S2MPS11_REGULATOR_MAX; i++)
-               regulator_unregister(s2mps11->rdev[i]);
-
-       return ret;
-}
-
-static int s2mps11_pmic_remove(struct platform_device *pdev)
-{
-       struct s2mps11_info *s2mps11 = platform_get_drvdata(pdev);
-       int i;
-
-       for (i = 0; i < S2MPS11_REGULATOR_MAX; i++)
-               regulator_unregister(s2mps11->rdev[i]);
-
        return 0;
 }
 
@@ -489,7 +472,6 @@ static struct platform_driver s2mps11_pmic_driver = {
                .owner = THIS_MODULE,
        },
        .probe = s2mps11_pmic_probe,
-       .remove = s2mps11_pmic_remove,
        .id_table = s2mps11_pmic_id,
 };