video: driver: utilize mod_delayed_work functionality
mod_delayed_work() is a replacement for cancel_delayed_work() + queue_delayed_work(). It will update only timer value, instead of completely cancelling and queueing a new delayed work. Change-Id: Id07d54e025c5a2e82f29160ae6d249d44f00bb15 Signed-off-by: Govindaraj Rajagopal <grajagop@codeaurora.org>
This commit is contained in:
@@ -1437,8 +1437,7 @@ static int schedule_batch_work(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
core = inst->core;
|
||||
cancel_delayed_work(&inst->decode_batch.work);
|
||||
queue_delayed_work(core->batch_workq, &inst->decode_batch.work,
|
||||
mod_delayed_work(core->batch_workq, &inst->decode_batch.work,
|
||||
msecs_to_jiffies(core->capabilities[DECODE_BATCH_TIMEOUT].value));
|
||||
|
||||
return 0;
|
||||
|
@@ -346,10 +346,8 @@ static void __schedule_power_collapse_work(struct msm_vidc_core *core)
|
||||
return;
|
||||
}
|
||||
|
||||
cancel_delayed_work(&core->pm_work);
|
||||
if (!queue_delayed_work(core->pm_workq,
|
||||
&core->pm_work, msecs_to_jiffies(
|
||||
core->capabilities[SW_PC_DELAY].value))) {
|
||||
if (!mod_delayed_work(core->pm_workq, &core->pm_work,
|
||||
msecs_to_jiffies(core->capabilities[SW_PC_DELAY].value))) {
|
||||
d_vpr_e("power collapse already scheduled\n");
|
||||
} else {
|
||||
d_vpr_l("power collapse scheduled for %d ms\n",
|
||||
|
Reference in New Issue
Block a user