aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power')
-rw-r--r--drivers/power/ab8500_bmdata.c6
-rw-r--r--drivers/power/olpc_battery.c2
-rw-r--r--drivers/power/reset/gpio-poweroff.c39
-rw-r--r--drivers/power/rx51_battery.c6
4 files changed, 24 insertions, 29 deletions
diff --git a/drivers/power/ab8500_bmdata.c b/drivers/power/ab8500_bmdata.c
index 03cc528425cb..f034ae43e045 100644
--- a/drivers/power/ab8500_bmdata.c
+++ b/drivers/power/ab8500_bmdata.c
@@ -452,10 +452,8 @@ struct abx500_bm_data ab8500_bm_data = {
452 .fg_params = &fg, 452 .fg_params = &fg,
453}; 453};
454 454
455int __devinit 455int bmdevs_of_probe(struct device *dev, struct device_node *np,
456bmdevs_of_probe(struct device *dev, 456 struct abx500_bm_data **battery)
457 struct device_node *np,
458 struct abx500_bm_data **battery)
459{ 457{
460 struct abx500_battery_type *btype; 458 struct abx500_battery_type *btype;
461 struct device_node *np_bat_supply; 459 struct device_node *np_bat_supply;
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c
index 298c47d111b4..1ec810ada5ed 100644
--- a/drivers/power/olpc_battery.c
+++ b/drivers/power/olpc_battery.c
@@ -668,7 +668,7 @@ static int olpc_battery_remove(struct platform_device *pdev)
668 return 0; 668 return 0;
669} 669}
670 670
671static const struct of_device_id olpc_battery_ids[] __devinitconst = { 671static const struct of_device_id olpc_battery_ids[] = {
672 { .compatible = "olpc,xo1-battery" }, 672 { .compatible = "olpc,xo1-battery" },
673 {} 673 {}
674}; 674};
diff --git a/drivers/power/reset/gpio-poweroff.c b/drivers/power/reset/gpio-poweroff.c
index 0491e5335d02..e290d48ddd99 100644
--- a/drivers/power/reset/gpio-poweroff.c
+++ b/drivers/power/reset/gpio-poweroff.c
@@ -29,15 +29,16 @@ static int gpio_active_low;
29 29
30static void gpio_poweroff_do_poweroff(void) 30static void gpio_poweroff_do_poweroff(void)
31{ 31{
32 BUG_ON(gpio_num == -1); 32 BUG_ON(!gpio_is_valid(gpio_num));
33 33
34 /* drive it active */ 34 /* drive it active, also inactive->active edge */
35 gpio_direction_output(gpio_num, !gpio_active_low); 35 gpio_direction_output(gpio_num, !gpio_active_low);
36 mdelay(100); 36 mdelay(100);
37 /* rising edge or drive inactive */ 37 /* drive inactive, also active->inactive edge */
38 gpio_set_value(gpio_num, gpio_active_low); 38 gpio_set_value(gpio_num, gpio_active_low);
39 mdelay(100); 39 mdelay(100);
40 /* falling edge */ 40
41 /* drive it active, also inactive->active edge */
41 gpio_set_value(gpio_num, !gpio_active_low); 42 gpio_set_value(gpio_num, !gpio_active_low);
42 43
43 /* give it some time */ 44 /* give it some time */
@@ -46,7 +47,7 @@ static void gpio_poweroff_do_poweroff(void)
46 WARN_ON(1); 47 WARN_ON(1);
47} 48}
48 49
49static int __devinit gpio_poweroff_probe(struct platform_device *pdev) 50static int gpio_poweroff_probe(struct platform_device *pdev)
50{ 51{
51 enum of_gpio_flags flags; 52 enum of_gpio_flags flags;
52 bool input = false; 53 bool input = false;
@@ -60,15 +61,12 @@ static int __devinit gpio_poweroff_probe(struct platform_device *pdev)
60 } 61 }
61 62
62 gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags); 63 gpio_num = of_get_gpio_flags(pdev->dev.of_node, 0, &flags);
63 if (gpio_num < 0) { 64 if (!gpio_is_valid(gpio_num))
64 pr_err("%s: Could not get GPIO configuration: %d", 65 return gpio_num;
65 __func__, gpio_num); 66
66 return -ENODEV;
67 }
68 gpio_active_low = flags & OF_GPIO_ACTIVE_LOW; 67 gpio_active_low = flags & OF_GPIO_ACTIVE_LOW;
69 68
70 if (of_get_property(pdev->dev.of_node, "input", NULL)) 69 input = of_property_read_bool(pdev->dev.of_node, "input");
71 input = true;
72 70
73 ret = gpio_request(gpio_num, "poweroff-gpio"); 71 ret = gpio_request(gpio_num, "poweroff-gpio");
74 if (ret) { 72 if (ret) {
@@ -96,10 +94,9 @@ err:
96 return -ENODEV; 94 return -ENODEV;
97} 95}
98 96
99static int __devexit gpio_poweroff_remove(struct platform_device *pdev) 97static int gpio_poweroff_remove(struct platform_device *pdev)
100{ 98{
101 if (gpio_num != -1) 99 gpio_free(gpio_num);
102 gpio_free(gpio_num);
103 if (pm_power_off == &gpio_poweroff_do_poweroff) 100 if (pm_power_off == &gpio_poweroff_do_poweroff)
104 pm_power_off = NULL; 101 pm_power_off = NULL;
105 102
@@ -113,17 +110,17 @@ static const struct of_device_id of_gpio_poweroff_match[] = {
113 110
114static struct platform_driver gpio_poweroff_driver = { 111static struct platform_driver gpio_poweroff_driver = {
115 .probe = gpio_poweroff_probe, 112 .probe = gpio_poweroff_probe,
116 .remove = __devexit_p(gpio_poweroff_remove), 113 .remove = gpio_poweroff_remove,
117 .driver = { 114 .driver = {
118 .name = "poweroff-gpio", 115 .name = "poweroff-gpio",
119 .owner = THIS_MODULE, 116 .owner = THIS_MODULE,
120 .of_match_table = of_gpio_poweroff_match, 117 .of_match_table = of_gpio_poweroff_match,
121 }, 118 },
122}; 119};
123 120
124module_platform_driver(gpio_poweroff_driver); 121module_platform_driver(gpio_poweroff_driver);
125 122
126MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>"); 123MODULE_AUTHOR("Jamie Lentin <jm@lentin.co.uk>");
127MODULE_DESCRIPTION("GPIO poweroff driver"); 124MODULE_DESCRIPTION("GPIO poweroff driver");
128MODULE_LICENSE("GPL"); 125MODULE_LICENSE("GPL v2");
129MODULE_ALIAS("platform:poweroff-gpio"); 126MODULE_ALIAS("platform:poweroff-gpio");
diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
index ca49d6c0ee9d..8208888b844e 100644
--- a/drivers/power/rx51_battery.c
+++ b/drivers/power/rx51_battery.c
@@ -197,7 +197,7 @@ static enum power_supply_property rx51_battery_props[] = {
197 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN, 197 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
198}; 198};
199 199
200static int __devinit rx51_battery_probe(struct platform_device *pdev) 200static int rx51_battery_probe(struct platform_device *pdev)
201{ 201{
202 struct rx51_device_info *di; 202 struct rx51_device_info *di;
203 int ret; 203 int ret;
@@ -224,7 +224,7 @@ static int __devinit rx51_battery_probe(struct platform_device *pdev)
224 return 0; 224 return 0;
225} 225}
226 226
227static int __devexit rx51_battery_remove(struct platform_device *pdev) 227static int rx51_battery_remove(struct platform_device *pdev)
228{ 228{
229 struct rx51_device_info *di = platform_get_drvdata(pdev); 229 struct rx51_device_info *di = platform_get_drvdata(pdev);
230 230
@@ -237,7 +237,7 @@ static int __devexit rx51_battery_remove(struct platform_device *pdev)
237 237
238static struct platform_driver rx51_battery_driver = { 238static struct platform_driver rx51_battery_driver = {
239 .probe = rx51_battery_probe, 239 .probe = rx51_battery_probe,
240 .remove = __devexit_p(rx51_battery_remove), 240 .remove = rx51_battery_remove,
241 .driver = { 241 .driver = {
242 .name = "rx51-battery", 242 .name = "rx51-battery",
243 .owner = THIS_MODULE, 243 .owner = THIS_MODULE,