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/z2_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/z2_battery.c')
-rw-r--r-- | drivers/power/z2_battery.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/power/z2_battery.c b/drivers/power/z2_battery.c index 85064a9f649e..e5ed52d71937 100644 --- a/drivers/power/z2_battery.c +++ b/drivers/power/z2_battery.c | |||
@@ -254,7 +254,7 @@ static int __devexit z2_batt_remove(struct i2c_client *client) | |||
254 | struct z2_charger *charger = i2c_get_clientdata(client); | 254 | struct z2_charger *charger = i2c_get_clientdata(client); |
255 | struct z2_battery_info *info = charger->info; | 255 | struct z2_battery_info *info = charger->info; |
256 | 256 | ||
257 | flush_scheduled_work(); | 257 | cancel_work_sync(&charger->bat_work); |
258 | power_supply_unregister(&charger->batt_ps); | 258 | power_supply_unregister(&charger->batt_ps); |
259 | 259 | ||
260 | kfree(charger->batt_ps.properties); | 260 | kfree(charger->batt_ps.properties); |
@@ -271,7 +271,9 @@ static int __devexit z2_batt_remove(struct i2c_client *client) | |||
271 | #ifdef CONFIG_PM | 271 | #ifdef CONFIG_PM |
272 | static int z2_batt_suspend(struct i2c_client *client, pm_message_t state) | 272 | static int z2_batt_suspend(struct i2c_client *client, pm_message_t state) |
273 | { | 273 | { |
274 | flush_scheduled_work(); | 274 | struct z2_charger *charger = i2c_get_clientdata(client); |
275 | |||
276 | flush_work_sync(&charger->bat_work); | ||
275 | return 0; | 277 | return 0; |
276 | } | 278 | } |
277 | 279 | ||