diff options
author | Lee Jones <lee.jones@linaro.org> | 2012-12-21 20:56:52 -0500 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2013-03-06 23:35:59 -0500 |
commit | b09f86dbfc20d9420dac43dba016cb65b582c983 (patch) | |
tree | f575c981d4b6fc2bcc6f61c5897621d4e02059d4 /drivers/power | |
parent | 0577610e0e6b431a1503cc5d78e8178e0dd59948 (diff) |
ab8500-charger: Do not use [delayed_]work_pending()
There's no need to test whether a (delayed) work item is pending
before queueing, flushing or cancelling it. Most uses are unnecessary
and quite a few of them are buggy.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/power')
-rw-r--r-- | drivers/power/ab8500_charger.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/power/ab8500_charger.c b/drivers/power/ab8500_charger.c index 81c9615fd726..a558318b169c 100644 --- a/drivers/power/ab8500_charger.c +++ b/drivers/power/ab8500_charger.c | |||
@@ -1661,8 +1661,7 @@ static int ab8500_charger_usb_en(struct ux500_charger *charger, | |||
1661 | dev_dbg(di->dev, "%s Disabled USB charging\n", __func__); | 1661 | dev_dbg(di->dev, "%s Disabled USB charging\n", __func__); |
1662 | 1662 | ||
1663 | /* Cancel any pending Vbat check work */ | 1663 | /* Cancel any pending Vbat check work */ |
1664 | if (delayed_work_pending(&di->check_vbat_work)) | 1664 | cancel_delayed_work(&di->check_vbat_work); |
1665 | cancel_delayed_work(&di->check_vbat_work); | ||
1666 | 1665 | ||
1667 | } | 1666 | } |
1668 | ab8500_power_supply_changed(di, &di->usb_chg.psy); | 1667 | ab8500_power_supply_changed(di, &di->usb_chg.psy); |
@@ -3335,11 +3334,8 @@ static int ab8500_charger_resume(struct platform_device *pdev) | |||
3335 | dev_err(di->dev, "Failed to kick WD!\n"); | 3334 | dev_err(di->dev, "Failed to kick WD!\n"); |
3336 | 3335 | ||
3337 | /* If not already pending start a new timer */ | 3336 | /* If not already pending start a new timer */ |
3338 | if (!delayed_work_pending( | 3337 | queue_delayed_work(di->charger_wq, &di->kick_wd_work, |
3339 | &di->kick_wd_work)) { | 3338 | round_jiffies(WD_KICK_INTERVAL)); |
3340 | queue_delayed_work(di->charger_wq, &di->kick_wd_work, | ||
3341 | round_jiffies(WD_KICK_INTERVAL)); | ||
3342 | } | ||
3343 | } | 3339 | } |
3344 | 3340 | ||
3345 | /* If we still have a HW failure, schedule a new check */ | 3341 | /* If we still have a HW failure, schedule a new check */ |
@@ -3359,12 +3355,9 @@ static int ab8500_charger_suspend(struct platform_device *pdev, | |||
3359 | { | 3355 | { |
3360 | struct ab8500_charger *di = platform_get_drvdata(pdev); | 3356 | struct ab8500_charger *di = platform_get_drvdata(pdev); |
3361 | 3357 | ||
3362 | /* Cancel any pending HW failure check */ | 3358 | /* Cancel any pending jobs */ |
3363 | if (delayed_work_pending(&di->check_hw_failure_work)) | 3359 | cancel_delayed_work(&di->check_hw_failure_work); |
3364 | cancel_delayed_work(&di->check_hw_failure_work); | 3360 | cancel_delayed_work(&di->vbus_drop_end_work); |
3365 | |||
3366 | if (delayed_work_pending(&di->vbus_drop_end_work)) | ||
3367 | cancel_delayed_work(&di->vbus_drop_end_work); | ||
3368 | 3361 | ||
3369 | flush_delayed_work(&di->attach_work); | 3362 | flush_delayed_work(&di->attach_work); |
3370 | flush_delayed_work(&di->usb_charger_attached_work); | 3363 | flush_delayed_work(&di->usb_charger_attached_work); |