diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-15 19:56:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-15 19:56:12 -0400 |
commit | 8f41958bdd577731f7411c9605cfaa9db6766809 (patch) | |
tree | 424776ff9ffe3fac011634c7c8db15dee839b0bb /drivers | |
parent | bc06cffdec85d487c77109dffcd2f285bdc502d3 (diff) | |
parent | 0909fca51346d0ece688532c54d41ebc986aef7f (diff) |
Merge git://git.infradead.org/battery-2.6
* git://git.infradead.org/battery-2.6:
git-battery vs git-acpi
Power supply class and drivers: remove non obligatory return statements
pda_power: clean up irq, timer
MAINTAINERS: Add maintainers for power supply subsystem and drivers
Fixed up trivial conflict in drivers/w1/slaves/w1_ds2760.c manually
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/power/apm_power.c | 4 | ||||
-rw-r--r-- | drivers/power/ds2760_battery.c | 7 | ||||
-rw-r--r-- | drivers/power/olpc_battery.c | 1 | ||||
-rw-r--r-- | drivers/power/pda_power.c | 22 | ||||
-rw-r--r-- | drivers/power/pmu_battery.c | 2 | ||||
-rw-r--r-- | drivers/power/power_supply_core.c | 6 | ||||
-rw-r--r-- | drivers/power/power_supply_leds.c | 8 | ||||
-rw-r--r-- | drivers/power/power_supply_sysfs.c | 2 | ||||
-rw-r--r-- | drivers/w1/slaves/w1_ds2760.c | 7 |
9 files changed, 10 insertions, 49 deletions
diff --git a/drivers/power/apm_power.c b/drivers/power/apm_power.c index 042bd950d036..39a90a6f0f80 100644 --- a/drivers/power/apm_power.c +++ b/drivers/power/apm_power.c | |||
@@ -48,8 +48,6 @@ static void find_main_battery(void) | |||
48 | } | 48 | } |
49 | if (!main_battery) | 49 | if (!main_battery) |
50 | main_battery = batm; | 50 | main_battery = batm; |
51 | |||
52 | return; | ||
53 | } | 51 | } |
54 | 52 | ||
55 | static int calculate_time(int status) | 53 | static int calculate_time(int status) |
@@ -218,7 +216,6 @@ static void apm_battery_apm_get_power_status(struct apm_power_info *info) | |||
218 | } | 216 | } |
219 | 217 | ||
220 | up(&power_supply_class->sem); | 218 | up(&power_supply_class->sem); |
221 | return; | ||
222 | } | 219 | } |
223 | 220 | ||
224 | static int __init apm_battery_init(void) | 221 | static int __init apm_battery_init(void) |
@@ -232,7 +229,6 @@ static int __init apm_battery_init(void) | |||
232 | static void __exit apm_battery_exit(void) | 229 | static void __exit apm_battery_exit(void) |
233 | { | 230 | { |
234 | apm_get_power_status = NULL; | 231 | apm_get_power_status = NULL; |
235 | return; | ||
236 | } | 232 | } |
237 | 233 | ||
238 | module_init(apm_battery_init); | 234 | module_init(apm_battery_init); |
diff --git a/drivers/power/ds2760_battery.c b/drivers/power/ds2760_battery.c index 00e1ea6f1de2..be7021ee3611 100644 --- a/drivers/power/ds2760_battery.c +++ b/drivers/power/ds2760_battery.c | |||
@@ -254,8 +254,6 @@ static void ds2760_battery_update_status(struct ds2760_device_info *di) | |||
254 | 254 | ||
255 | if (di->charge_status != old_charge_status) | 255 | if (di->charge_status != old_charge_status) |
256 | power_supply_changed(&di->bat); | 256 | power_supply_changed(&di->bat); |
257 | |||
258 | return; | ||
259 | } | 257 | } |
260 | 258 | ||
261 | static void ds2760_battery_work(struct work_struct *work) | 259 | static void ds2760_battery_work(struct work_struct *work) |
@@ -268,8 +266,6 @@ static void ds2760_battery_work(struct work_struct *work) | |||
268 | 266 | ||
269 | ds2760_battery_update_status(di); | 267 | ds2760_battery_update_status(di); |
270 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, interval); | 268 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, interval); |
271 | |||
272 | return; | ||
273 | } | 269 | } |
274 | 270 | ||
275 | #define to_ds2760_device_info(x) container_of((x), struct ds2760_device_info, \ | 271 | #define to_ds2760_device_info(x) container_of((x), struct ds2760_device_info, \ |
@@ -283,8 +279,6 @@ static void ds2760_battery_external_power_changed(struct power_supply *psy) | |||
283 | 279 | ||
284 | cancel_delayed_work(&di->monitor_work); | 280 | cancel_delayed_work(&di->monitor_work); |
285 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10); | 281 | queue_delayed_work(di->monitor_wqueue, &di->monitor_work, HZ/10); |
286 | |||
287 | return; | ||
288 | } | 282 | } |
289 | 283 | ||
290 | static int ds2760_battery_get_property(struct power_supply *psy, | 284 | static int ds2760_battery_get_property(struct power_supply *psy, |
@@ -457,7 +451,6 @@ static int __init ds2760_battery_init(void) | |||
457 | static void __exit ds2760_battery_exit(void) | 451 | static void __exit ds2760_battery_exit(void) |
458 | { | 452 | { |
459 | platform_driver_unregister(&ds2760_battery_driver); | 453 | platform_driver_unregister(&ds2760_battery_driver); |
460 | return; | ||
461 | } | 454 | } |
462 | 455 | ||
463 | module_init(ds2760_battery_init); | 456 | module_init(ds2760_battery_init); |
diff --git a/drivers/power/olpc_battery.c b/drivers/power/olpc_battery.c index 878684df7667..c998e68d060f 100644 --- a/drivers/power/olpc_battery.c +++ b/drivers/power/olpc_battery.c | |||
@@ -341,7 +341,6 @@ static void __exit olpc_bat_exit(void) | |||
341 | power_supply_unregister(&olpc_bat); | 341 | power_supply_unregister(&olpc_bat); |
342 | power_supply_unregister(&olpc_ac); | 342 | power_supply_unregister(&olpc_ac); |
343 | platform_device_unregister(bat_pdev); | 343 | platform_device_unregister(bat_pdev); |
344 | return; | ||
345 | } | 344 | } |
346 | 345 | ||
347 | module_init(olpc_bat_init); | 346 | module_init(olpc_bat_init); |
diff --git a/drivers/power/pda_power.c b/drivers/power/pda_power.c index 4e1eb040e148..c058f285be1a 100644 --- a/drivers/power/pda_power.c +++ b/drivers/power/pda_power.c | |||
@@ -97,36 +97,31 @@ static void update_charger(void) | |||
97 | dev_dbg(dev, "charger off\n"); | 97 | dev_dbg(dev, "charger off\n"); |
98 | pdata->set_charge(0); | 98 | pdata->set_charge(0); |
99 | } | 99 | } |
100 | |||
101 | return; | ||
102 | } | 100 | } |
103 | 101 | ||
104 | static void supply_timer_func(unsigned long irq) | 102 | static void supply_timer_func(unsigned long power_supply_ptr) |
105 | { | 103 | { |
106 | if (ac_irq && irq == ac_irq->start) | 104 | void *power_supply = (void *)power_supply_ptr; |
107 | power_supply_changed(&pda_power_supplies[0]); | 105 | |
108 | else if (usb_irq && irq == usb_irq->start) | 106 | power_supply_changed(power_supply); |
109 | power_supply_changed(&pda_power_supplies[1]); | ||
110 | return; | ||
111 | } | 107 | } |
112 | 108 | ||
113 | static void charger_timer_func(unsigned long irq) | 109 | static void charger_timer_func(unsigned long power_supply_ptr) |
114 | { | 110 | { |
115 | update_charger(); | 111 | update_charger(); |
116 | 112 | ||
117 | /* Okay, charger set. Now wait a bit before notifying supplicants, | 113 | /* Okay, charger set. Now wait a bit before notifying supplicants, |
118 | * charge power should stabilize. */ | 114 | * charge power should stabilize. */ |
119 | supply_timer.data = irq; | 115 | supply_timer.data = power_supply_ptr; |
120 | mod_timer(&supply_timer, | 116 | mod_timer(&supply_timer, |
121 | jiffies + msecs_to_jiffies(pdata->wait_for_charger)); | 117 | jiffies + msecs_to_jiffies(pdata->wait_for_charger)); |
122 | return; | ||
123 | } | 118 | } |
124 | 119 | ||
125 | static irqreturn_t power_changed_isr(int irq, void *unused) | 120 | static irqreturn_t power_changed_isr(int irq, void *power_supply) |
126 | { | 121 | { |
127 | /* Wait a bit before reading ac/usb line status and setting charger, | 122 | /* Wait a bit before reading ac/usb line status and setting charger, |
128 | * because ac/usb status readings may lag from irq. */ | 123 | * because ac/usb status readings may lag from irq. */ |
129 | charger_timer.data = irq; | 124 | charger_timer.data = (unsigned long)power_supply; |
130 | mod_timer(&charger_timer, | 125 | mod_timer(&charger_timer, |
131 | jiffies + msecs_to_jiffies(pdata->wait_for_status)); | 126 | jiffies + msecs_to_jiffies(pdata->wait_for_status)); |
132 | return IRQ_HANDLED; | 127 | return IRQ_HANDLED; |
@@ -252,7 +247,6 @@ static int __init pda_power_init(void) | |||
252 | static void __exit pda_power_exit(void) | 247 | static void __exit pda_power_exit(void) |
253 | { | 248 | { |
254 | platform_driver_unregister(&pda_power_pdrv); | 249 | platform_driver_unregister(&pda_power_pdrv); |
255 | return; | ||
256 | } | 250 | } |
257 | 251 | ||
258 | module_init(pda_power_init); | 252 | module_init(pda_power_init); |
diff --git a/drivers/power/pmu_battery.c b/drivers/power/pmu_battery.c index 2fea4af0e40a..60a8cf3a0431 100644 --- a/drivers/power/pmu_battery.c +++ b/drivers/power/pmu_battery.c | |||
@@ -203,8 +203,6 @@ static void __exit pmu_bat_exit(void) | |||
203 | } | 203 | } |
204 | power_supply_unregister(&pmu_ac); | 204 | power_supply_unregister(&pmu_ac); |
205 | platform_device_unregister(bat_pdev); | 205 | platform_device_unregister(bat_pdev); |
206 | |||
207 | return; | ||
208 | } | 206 | } |
209 | 207 | ||
210 | module_init(pmu_bat_init); | 208 | module_init(pmu_bat_init); |
diff --git a/drivers/power/power_supply_core.c b/drivers/power/power_supply_core.c index e87ea5156755..a63b75cf75e2 100644 --- a/drivers/power/power_supply_core.c +++ b/drivers/power/power_supply_core.c | |||
@@ -46,8 +46,6 @@ static void power_supply_changed_work(struct work_struct *work) | |||
46 | power_supply_update_leds(psy); | 46 | power_supply_update_leds(psy); |
47 | 47 | ||
48 | kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE); | 48 | kobject_uevent(&psy->dev->kobj, KOBJ_CHANGE); |
49 | |||
50 | return; | ||
51 | } | 49 | } |
52 | 50 | ||
53 | void power_supply_changed(struct power_supply *psy) | 51 | void power_supply_changed(struct power_supply *psy) |
@@ -55,8 +53,6 @@ void power_supply_changed(struct power_supply *psy) | |||
55 | dev_dbg(psy->dev, "%s\n", __FUNCTION__); | 53 | dev_dbg(psy->dev, "%s\n", __FUNCTION__); |
56 | 54 | ||
57 | schedule_work(&psy->changed_work); | 55 | schedule_work(&psy->changed_work); |
58 | |||
59 | return; | ||
60 | } | 56 | } |
61 | 57 | ||
62 | int power_supply_am_i_supplied(struct power_supply *psy) | 58 | int power_supply_am_i_supplied(struct power_supply *psy) |
@@ -129,7 +125,6 @@ void power_supply_unregister(struct power_supply *psy) | |||
129 | power_supply_remove_triggers(psy); | 125 | power_supply_remove_triggers(psy); |
130 | power_supply_remove_attrs(psy); | 126 | power_supply_remove_attrs(psy); |
131 | device_unregister(psy->dev); | 127 | device_unregister(psy->dev); |
132 | return; | ||
133 | } | 128 | } |
134 | 129 | ||
135 | static int __init power_supply_class_init(void) | 130 | static int __init power_supply_class_init(void) |
@@ -147,7 +142,6 @@ static int __init power_supply_class_init(void) | |||
147 | static void __exit power_supply_class_exit(void) | 142 | static void __exit power_supply_class_exit(void) |
148 | { | 143 | { |
149 | class_destroy(power_supply_class); | 144 | class_destroy(power_supply_class); |
150 | return; | ||
151 | } | 145 | } |
152 | 146 | ||
153 | EXPORT_SYMBOL_GPL(power_supply_changed); | 147 | EXPORT_SYMBOL_GPL(power_supply_changed); |
diff --git a/drivers/power/power_supply_leds.c b/drivers/power/power_supply_leds.c index 7232490bb595..7f8f3590b02e 100644 --- a/drivers/power/power_supply_leds.c +++ b/drivers/power/power_supply_leds.c | |||
@@ -40,8 +40,6 @@ static void power_supply_update_bat_leds(struct power_supply *psy) | |||
40 | led_trigger_event(psy->full_trig, LED_OFF); | 40 | led_trigger_event(psy->full_trig, LED_OFF); |
41 | break; | 41 | break; |
42 | } | 42 | } |
43 | |||
44 | return; | ||
45 | } | 43 | } |
46 | 44 | ||
47 | static int power_supply_create_bat_triggers(struct power_supply *psy) | 45 | static int power_supply_create_bat_triggers(struct power_supply *psy) |
@@ -97,7 +95,6 @@ static void power_supply_remove_bat_triggers(struct power_supply *psy) | |||
97 | kfree(psy->full_trig_name); | 95 | kfree(psy->full_trig_name); |
98 | kfree(psy->charging_trig_name); | 96 | kfree(psy->charging_trig_name); |
99 | kfree(psy->charging_full_trig_name); | 97 | kfree(psy->charging_full_trig_name); |
100 | return; | ||
101 | } | 98 | } |
102 | 99 | ||
103 | /* Generated power specific LEDs triggers. */ | 100 | /* Generated power specific LEDs triggers. */ |
@@ -115,8 +112,6 @@ static void power_supply_update_gen_leds(struct power_supply *psy) | |||
115 | led_trigger_event(psy->online_trig, LED_FULL); | 112 | led_trigger_event(psy->online_trig, LED_FULL); |
116 | else | 113 | else |
117 | led_trigger_event(psy->online_trig, LED_OFF); | 114 | led_trigger_event(psy->online_trig, LED_OFF); |
118 | |||
119 | return; | ||
120 | } | 115 | } |
121 | 116 | ||
122 | static int power_supply_create_gen_triggers(struct power_supply *psy) | 117 | static int power_supply_create_gen_triggers(struct power_supply *psy) |
@@ -145,7 +140,6 @@ static void power_supply_remove_gen_triggers(struct power_supply *psy) | |||
145 | { | 140 | { |
146 | led_trigger_unregister_simple(psy->online_trig); | 141 | led_trigger_unregister_simple(psy->online_trig); |
147 | kfree(psy->online_trig_name); | 142 | kfree(psy->online_trig_name); |
148 | return; | ||
149 | } | 143 | } |
150 | 144 | ||
151 | /* Choice what triggers to create&update. */ | 145 | /* Choice what triggers to create&update. */ |
@@ -156,7 +150,6 @@ void power_supply_update_leds(struct power_supply *psy) | |||
156 | power_supply_update_bat_leds(psy); | 150 | power_supply_update_bat_leds(psy); |
157 | else | 151 | else |
158 | power_supply_update_gen_leds(psy); | 152 | power_supply_update_gen_leds(psy); |
159 | return; | ||
160 | } | 153 | } |
161 | 154 | ||
162 | int power_supply_create_triggers(struct power_supply *psy) | 155 | int power_supply_create_triggers(struct power_supply *psy) |
@@ -172,5 +165,4 @@ void power_supply_remove_triggers(struct power_supply *psy) | |||
172 | power_supply_remove_bat_triggers(psy); | 165 | power_supply_remove_bat_triggers(psy); |
173 | else | 166 | else |
174 | power_supply_remove_gen_triggers(psy); | 167 | power_supply_remove_gen_triggers(psy); |
175 | return; | ||
176 | } | 168 | } |
diff --git a/drivers/power/power_supply_sysfs.c b/drivers/power/power_supply_sysfs.c index c07d4258d347..c7c4574729b1 100644 --- a/drivers/power/power_supply_sysfs.c +++ b/drivers/power/power_supply_sysfs.c | |||
@@ -176,8 +176,6 @@ void power_supply_remove_attrs(struct power_supply *psy) | |||
176 | for (i = 0; i < psy->num_properties; i++) | 176 | for (i = 0; i < psy->num_properties; i++) |
177 | device_remove_file(psy->dev, | 177 | device_remove_file(psy->dev, |
178 | &power_supply_attrs[psy->properties[i]]); | 178 | &power_supply_attrs[psy->properties[i]]); |
179 | |||
180 | return; | ||
181 | } | 179 | } |
182 | 180 | ||
183 | static char *kstruprdup(const char *str, gfp_t gfp) | 181 | static char *kstruprdup(const char *str, gfp_t gfp) |
diff --git a/drivers/w1/slaves/w1_ds2760.c b/drivers/w1/slaves/w1_ds2760.c index 1f2b1a4d5fb3..ed6b0576208c 100644 --- a/drivers/w1/slaves/w1_ds2760.c +++ b/drivers/w1/slaves/w1_ds2760.c | |||
@@ -68,7 +68,8 @@ int w1_ds2760_write(struct device *dev, char *buf, int addr, size_t count) | |||
68 | return w1_ds2760_io(dev, buf, addr, count, 1); | 68 | return w1_ds2760_io(dev, buf, addr, count, 1); |
69 | } | 69 | } |
70 | 70 | ||
71 | static ssize_t w1_ds2760_read_bin(struct kobject *kobj, struct bin_attribute *attr, | 71 | static ssize_t w1_ds2760_read_bin(struct kobject *kobj, |
72 | struct bin_attribute *bin_attr, | ||
72 | char *buf, loff_t off, size_t count) | 73 | char *buf, loff_t off, size_t count) |
73 | { | 74 | { |
74 | struct device *dev = container_of(kobj, struct device, kobj); | 75 | struct device *dev = container_of(kobj, struct device, kobj); |
@@ -121,8 +122,6 @@ static void release_bat_id(int id) | |||
121 | mutex_lock(&bat_idr_lock); | 122 | mutex_lock(&bat_idr_lock); |
122 | idr_remove(&bat_idr, id); | 123 | idr_remove(&bat_idr, id); |
123 | mutex_unlock(&bat_idr_lock); | 124 | mutex_unlock(&bat_idr_lock); |
124 | |||
125 | return; | ||
126 | } | 125 | } |
127 | 126 | ||
128 | static int w1_ds2760_add_slave(struct w1_slave *sl) | 127 | static int w1_ds2760_add_slave(struct w1_slave *sl) |
@@ -174,8 +173,6 @@ static void w1_ds2760_remove_slave(struct w1_slave *sl) | |||
174 | platform_device_unregister(pdev); | 173 | platform_device_unregister(pdev); |
175 | release_bat_id(id); | 174 | release_bat_id(id); |
176 | sysfs_remove_bin_file(&sl->dev.kobj, &w1_ds2760_bin_attr); | 175 | sysfs_remove_bin_file(&sl->dev.kobj, &w1_ds2760_bin_attr); |
177 | |||
178 | return; | ||
179 | } | 176 | } |
180 | 177 | ||
181 | static struct w1_family_ops w1_ds2760_fops = { | 178 | static struct w1_family_ops w1_ds2760_fops = { |