aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/power/tosa_battery.c
diff options
context:
space:
mode:
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);