diff options
author | Tejun Heo <tj@kernel.org> | 2010-12-11 11:51:45 -0500 |
---|---|---|
committer | Anton Vorontsov <cbouatmailru@gmail.com> | 2010-12-21 18:39:56 -0500 |
commit | bc51e7ff521f28a7f14dc2f25307ad9101d1305a (patch) | |
tree | 011477cb2e90d2038261170a4e688f795d6720f9 /drivers/power/collie_battery.c | |
parent | 3a2dbd611b38cf9a026c0099a85701ad183d1949 (diff) |
power_supply: Don't use flush_scheduled_work()
flush_scheduled_work() is deprecated and scheduled to be removed.
In battery drivers, the work can be canceled on probe failure and
removal and should be flushed on suspend. Replace
flush_scheduled_work() usages with direct cancels and flushes.
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
Diffstat (limited to 'drivers/power/collie_battery.c')
-rw-r--r-- | drivers/power/collie_battery.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/power/collie_battery.c b/drivers/power/collie_battery.c index 039f41ae217d..548d263b1ad0 100644 --- a/drivers/power/collie_battery.c +++ b/drivers/power/collie_battery.c | |||
@@ -295,7 +295,7 @@ static struct { | |||
295 | static int collie_bat_suspend(struct ucb1x00_dev *dev, pm_message_t state) | 295 | static int collie_bat_suspend(struct ucb1x00_dev *dev, pm_message_t state) |
296 | { | 296 | { |
297 | /* flush all pending status updates */ | 297 | /* flush all pending status updates */ |
298 | flush_scheduled_work(); | 298 | flush_work_sync(&bat_work); |
299 | return 0; | 299 | return 0; |
300 | } | 300 | } |
301 | 301 | ||
@@ -362,7 +362,7 @@ err_psy_reg_bu: | |||
362 | err_psy_reg_main: | 362 | err_psy_reg_main: |
363 | 363 | ||
364 | /* see comment in collie_bat_remove */ | 364 | /* see comment in collie_bat_remove */ |
365 | flush_scheduled_work(); | 365 | cancel_work_sync(&bat_work); |
366 | 366 | ||
367 | i--; | 367 | i--; |
368 | err_gpio: | 368 | err_gpio: |
@@ -382,12 +382,11 @@ static void __devexit collie_bat_remove(struct ucb1x00_dev *dev) | |||
382 | power_supply_unregister(&collie_bat_main.psy); | 382 | power_supply_unregister(&collie_bat_main.psy); |
383 | 383 | ||
384 | /* | 384 | /* |
385 | * now flush all pending work. | 385 | * Now cancel the bat_work. We won't get any more schedules, |
386 | * we won't get any more schedules, since all | 386 | * since all sources (isr and external_power_changed) are |
387 | * sources (isr and external_power_changed) | 387 | * unregistered now. |
388 | * are unregistered now. | ||
389 | */ | 388 | */ |
390 | flush_scheduled_work(); | 389 | cancel_work_sync(&bat_work); |
391 | 390 | ||
392 | for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--) | 391 | for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--) |
393 | gpio_free(gpios[i].gpio); | 392 | gpio_free(gpios[i].gpio); |