aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/tosa_battery.c
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2010-12-11 11:51:45 -0500
committerAnton Vorontsov <cbouatmailru@gmail.com>2010-12-21 18:39:56 -0500
commitbc51e7ff521f28a7f14dc2f25307ad9101d1305a (patch)
tree011477cb2e90d2038261170a4e688f795d6720f9 /drivers/power/tosa_battery.c
parent3a2dbd611b38cf9a026c0099a85701ad183d1949 (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/tosa_battery.c')
-rw-r--r--drivers/power/tosa_battery.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/power/tosa_battery.c b/drivers/power/tosa_battery.c
index ee04936b2db5..53f0d3524fcd 100644
--- a/drivers/power/tosa_battery.c
+++ b/drivers/power/tosa_battery.c
@@ -332,7 +332,7 @@ static struct {
332static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state) 332static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state)
333{ 333{
334 /* flush all pending status updates */ 334 /* flush all pending status updates */
335 flush_scheduled_work(); 335 flush_work_sync(&bat_work);
336 return 0; 336 return 0;
337} 337}
338 338
@@ -422,7 +422,7 @@ err_psy_reg_jacket:
422err_psy_reg_main: 422err_psy_reg_main:
423 423
424 /* see comment in tosa_bat_remove */ 424 /* see comment in tosa_bat_remove */
425 flush_scheduled_work(); 425 cancel_work_sync(&bat_work);
426 426
427 i--; 427 i--;
428err_gpio: 428err_gpio:
@@ -445,12 +445,11 @@ static int __devexit tosa_bat_remove(struct platform_device *dev)
445 power_supply_unregister(&tosa_bat_main.psy); 445 power_supply_unregister(&tosa_bat_main.psy);
446 446
447 /* 447 /*
448 * now flush all pending work. 448 * Now cancel the bat_work. We won't get any more schedules,
449 * we won't get any more schedules, since all 449 * since all sources (isr and external_power_changed) are
450 * sources (isr and external_power_changed) 450 * unregistered now.
451 * are unregistered now.
452 */ 451 */
453 flush_scheduled_work(); 452 cancel_work_sync(&bat_work);
454 453
455 for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--) 454 for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--)
456 gpio_free(gpios[i].gpio); 455 gpio_free(gpios[i].gpio);