aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/wm8994-regulator.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/regulator/wm8994-regulator.c b/drivers/regulator/wm8994-regulator.c
index d09e018b3177..95454a4637b7 100644
--- a/drivers/regulator/wm8994-regulator.c
+++ b/drivers/regulator/wm8994-regulator.c
@@ -26,7 +26,7 @@
26 26
27struct wm8994_ldo { 27struct wm8994_ldo {
28 int enable; 28 int enable;
29 int is_enabled; 29 bool is_enabled;
30 struct regulator_dev *regulator; 30 struct regulator_dev *regulator;
31 struct wm8994 *wm8994; 31 struct wm8994 *wm8994;
32}; 32};
@@ -43,7 +43,7 @@ static int wm8994_ldo_enable(struct regulator_dev *rdev)
43 return 0; 43 return 0;
44 44
45 gpio_set_value(ldo->enable, 1); 45 gpio_set_value(ldo->enable, 1);
46 ldo->is_enabled = 1; 46 ldo->is_enabled = true;
47 47
48 return 0; 48 return 0;
49} 49}
@@ -57,7 +57,7 @@ static int wm8994_ldo_disable(struct regulator_dev *rdev)
57 return -EINVAL; 57 return -EINVAL;
58 58
59 gpio_set_value(ldo->enable, 0); 59 gpio_set_value(ldo->enable, 0);
60 ldo->is_enabled = 0; 60 ldo->is_enabled = false;
61 61
62 return 0; 62 return 0;
63} 63}
@@ -218,7 +218,7 @@ static __devinit int wm8994_ldo_probe(struct platform_device *pdev)
218 218
219 ldo->wm8994 = wm8994; 219 ldo->wm8994 = wm8994;
220 220
221 ldo->is_enabled = 1; 221 ldo->is_enabled = true;
222 222
223 if (pdata->ldo[id].enable && gpio_is_valid(pdata->ldo[id].enable)) { 223 if (pdata->ldo[id].enable && gpio_is_valid(pdata->ldo[id].enable)) {
224 ldo->enable = pdata->ldo[id].enable; 224 ldo->enable = pdata->ldo[id].enable;
@@ -263,6 +263,8 @@ static __devexit int wm8994_ldo_remove(struct platform_device *pdev)
263{ 263{
264 struct wm8994_ldo *ldo = platform_get_drvdata(pdev); 264 struct wm8994_ldo *ldo = platform_get_drvdata(pdev);
265 265
266 platform_set_drvdata(pdev, NULL);
267
266 regulator_unregister(ldo->regulator); 268 regulator_unregister(ldo->regulator);
267 if (gpio_is_valid(ldo->enable)) 269 if (gpio_is_valid(ldo->enable))
268 gpio_free(ldo->enable); 270 gpio_free(ldo->enable);
@@ -276,6 +278,7 @@ static struct platform_driver wm8994_ldo_driver = {
276 .remove = __devexit_p(wm8994_ldo_remove), 278 .remove = __devexit_p(wm8994_ldo_remove),
277 .driver = { 279 .driver = {
278 .name = "wm8994-ldo", 280 .name = "wm8994-ldo",
281 .owner = THIS_MODULE,
279 }, 282 },
280}; 283};
281 284