Commit 1b6b0ce2 authored by Chun-Kuang Hu's avatar Chun-Kuang Hu Committed by Jassi Brar

mailbox: mtk-cmdq: Use mailbox rx_callback

rx_callback is a standard mailbox callback mechanism and could cover the
function of proprietary cmdq_task_cb, so use the standard one instead of
the proprietary one. But the client driver has already used cmdq_task_cb,
so keep cmdq_task_cb until all client driver use rx_callback instead of
cmdq_task_cb.
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
Reviewed-by: default avatarYongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: default avatarJassi Brar <jaswinder.singh@linaro.org>
parent b3c0d72b
......@@ -188,8 +188,11 @@ static void cmdq_task_exec_done(struct cmdq_task *task, int sta)
WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL);
data.sta = sta;
data.data = cb->data;
if (cb->cb)
cb->cb(data);
mbox_chan_received_data(task->thread->chan, &data);
list_del(&task->list_entry);
}
......@@ -451,12 +454,13 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
list_for_each_entry_safe(task, tmp, &thread->task_busy_list,
list_entry) {
cb = &task->pkt->async_cb;
if (cb->cb) {
data.sta = -ECONNABORTED;
data.data = cb->data;
cb = &task->pkt->async_cb;
if (cb->cb)
cb->cb(data);
}
mbox_chan_received_data(task->thread->chan, &data);
list_del(&task->list_entry);
kfree(task);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment