提交 8ebc3b5a 编写于 作者: C Chun-Kuang Hu 提交者: Jassi Brar

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: NChun-Kuang Hu <chunkuang.hu@kernel.org>
Reviewed-by: NYongqiang Niu <yongqiang.niu@mediatek.com>
Signed-off-by: NJassi Brar <jaswinder.singh@linaro.org>
上级 1b6b0ce2
......@@ -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);
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册