mailbox: mtk-cmdq: Add struct cmdq_pkt in struct cmdq_cb_data

Current client use 'struct cmdq_pkt' as callback data, so
change 'void *data' to 'struct cmdq_pkt *pkt'. Keep data
until client use pkt instead of data.

Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Reviewed-by: Yongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
This commit is contained in:
Chun-Kuang Hu 2021-03-15 07:33:23 +08:00 committed by Jassi Brar
parent 1b6b0ce224
commit 8ebc3b5aa4
2 changed files with 3 additions and 0 deletions

View File

@ -188,6 +188,7 @@ 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;
data.pkt = task->pkt;
if (cb->cb)
cb->cb(data);
@ -456,6 +457,7 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
list_entry) {
data.sta = -ECONNABORTED;
data.data = cb->data;
data.pkt = task->pkt;
cb = &task->pkt->async_cb;
if (cb->cb)
cb->cb(data);

View File

@ -68,6 +68,7 @@ enum cmdq_code {
struct cmdq_cb_data {
int sta;
void *data;
struct cmdq_pkt *pkt;
};
typedef void (*cmdq_async_flush_cb)(struct cmdq_cb_data data);