diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2010-02-24 02:38:55 -0500 |
---|---|---|
committer | Liam Girdwood <lrg@slimlogic.co.uk> | 2010-03-22 15:44:44 -0400 |
commit | 3fff6c04d81a2852821135736fad2d8386464753 (patch) | |
tree | efd6c0dfab6f17429b76ab6f9c121f2b8a1e71f4 | |
parent | 220bf991b0366cc50a94feede3d7341fa5710ee4 (diff) |
Regulators: max8925-regulator - clean up driver data after removal
It is a good tone to reset driver data after unbinding the device.
Also change find_regulator_info() fro inline to __devinit - let compiler
figure out if it wants it to be inlined or not.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
-rw-r--r-- | drivers/regulator/max8925-regulator.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index 67873f08ed40..b6218f11c957 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -230,7 +230,7 @@ static struct max8925_regulator_info max8925_regulator_info[] = { | |||
230 | MAX8925_LDO(20, 750, 3900, 50), | 230 | MAX8925_LDO(20, 750, 3900, 50), |
231 | }; | 231 | }; |
232 | 232 | ||
233 | static inline struct max8925_regulator_info *find_regulator_info(int id) | 233 | static struct max8925_regulator_info * __devinit find_regulator_info(int id) |
234 | { | 234 | { |
235 | struct max8925_regulator_info *ri; | 235 | struct max8925_regulator_info *ri; |
236 | int i; | 236 | int i; |
@@ -247,7 +247,7 @@ static int __devinit max8925_regulator_probe(struct platform_device *pdev) | |||
247 | { | 247 | { |
248 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 248 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
249 | struct max8925_platform_data *pdata = chip->dev->platform_data; | 249 | struct max8925_platform_data *pdata = chip->dev->platform_data; |
250 | struct max8925_regulator_info *ri = NULL; | 250 | struct max8925_regulator_info *ri; |
251 | struct regulator_dev *rdev; | 251 | struct regulator_dev *rdev; |
252 | 252 | ||
253 | ri = find_regulator_info(pdev->id); | 253 | ri = find_regulator_info(pdev->id); |
@@ -274,7 +274,9 @@ static int __devexit max8925_regulator_remove(struct platform_device *pdev) | |||
274 | { | 274 | { |
275 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | 275 | struct regulator_dev *rdev = platform_get_drvdata(pdev); |
276 | 276 | ||
277 | platform_set_drvdata(pdev, NULL); | ||
277 | regulator_unregister(rdev); | 278 | regulator_unregister(rdev); |
279 | |||
278 | return 0; | 280 | return 0; |
279 | } | 281 | } |
280 | 282 | ||