|
@@ -332,7 +332,7 @@ static struct {
|
|
static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state)
|
|
static int tosa_bat_suspend(struct platform_device *dev, pm_message_t state)
|
|
{
|
|
{
|
|
/* flush all pending status updates */
|
|
/* flush all pending status updates */
|
|
- flush_scheduled_work();
|
|
|
|
|
|
+ flush_work_sync(&bat_work);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -422,7 +422,7 @@ err_psy_reg_jacket:
|
|
err_psy_reg_main:
|
|
err_psy_reg_main:
|
|
|
|
|
|
/* see comment in tosa_bat_remove */
|
|
/* see comment in tosa_bat_remove */
|
|
- flush_scheduled_work();
|
|
|
|
|
|
+ cancel_work_sync(&bat_work);
|
|
|
|
|
|
i--;
|
|
i--;
|
|
err_gpio:
|
|
err_gpio:
|
|
@@ -445,12 +445,11 @@ static int __devexit tosa_bat_remove(struct platform_device *dev)
|
|
power_supply_unregister(&tosa_bat_main.psy);
|
|
power_supply_unregister(&tosa_bat_main.psy);
|
|
|
|
|
|
/*
|
|
/*
|
|
- * now flush all pending work.
|
|
|
|
- * we won't get any more schedules, since all
|
|
|
|
- * sources (isr and external_power_changed)
|
|
|
|
- * are unregistered now.
|
|
|
|
|
|
+ * Now cancel the bat_work. We won't get any more schedules,
|
|
|
|
+ * since all sources (isr and external_power_changed) are
|
|
|
|
+ * unregistered now.
|
|
*/
|
|
*/
|
|
- flush_scheduled_work();
|
|
|
|
|
|
+ cancel_work_sync(&bat_work);
|
|
|
|
|
|
for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--)
|
|
for (i = ARRAY_SIZE(gpios) - 1; i >= 0; i--)
|
|
gpio_free(gpios[i].gpio);
|
|
gpio_free(gpios[i].gpio);
|