aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-09-29 20:57:23 -0400
committerMark Brown <broonie@linaro.org>2013-09-30 13:11:00 -0400
commit5e0165e5a91db2283e694023582c0fc23311ae59 (patch)
tree522d5f3b9931b1a9f382f2bd0ab410d3a14fb930
parent15dc006af830d85417c97b60a40b5a0b991ee32e (diff)
regulator: pcf50633: use devm_regulator_register()
Use devm_regulator_register() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/regulator/pcf50633-regulator.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/regulator/pcf50633-regulator.c b/drivers/regulator/pcf50633-regulator.c
index 0f3576d48abf..d7da1c15a6da 100644
--- a/drivers/regulator/pcf50633-regulator.c
+++ b/drivers/regulator/pcf50633-regulator.c
@@ -90,7 +90,8 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
90 config.driver_data = pcf; 90 config.driver_data = pcf;
91 config.regmap = pcf->regmap; 91 config.regmap = pcf->regmap;
92 92
93 rdev = regulator_register(&regulators[pdev->id], &config); 93 rdev = devm_regulator_register(&pdev->dev, &regulators[pdev->id],
94 &config);
94 if (IS_ERR(rdev)) 95 if (IS_ERR(rdev))
95 return PTR_ERR(rdev); 96 return PTR_ERR(rdev);
96 97
@@ -102,21 +103,11 @@ static int pcf50633_regulator_probe(struct platform_device *pdev)
102 return 0; 103 return 0;
103} 104}
104 105
105static int pcf50633_regulator_remove(struct platform_device *pdev)
106{
107 struct regulator_dev *rdev = platform_get_drvdata(pdev);
108
109 regulator_unregister(rdev);
110
111 return 0;
112}
113
114static struct platform_driver pcf50633_regulator_driver = { 106static struct platform_driver pcf50633_regulator_driver = {
115 .driver = { 107 .driver = {
116 .name = "pcf50633-regltr", 108 .name = "pcf50633-regltr",
117 }, 109 },
118 .probe = pcf50633_regulator_probe, 110 .probe = pcf50633_regulator_probe,
119 .remove = pcf50633_regulator_remove,
120}; 111};
121 112
122static int __init pcf50633_regulator_init(void) 113static int __init pcf50633_regulator_init(void)