]> git.ipfire.org Git - people/ms/linux.git/commitdiff
mailbox: mtk-cmdq: Remove proprietary cmdq_task_cb
authorChun-Kuang Hu <chunkuang.hu@kernel.org>
Wed, 8 Jun 2022 14:40:55 +0000 (22:40 +0800)
committerJassi Brar <jaswinder.singh@linaro.org>
Tue, 2 Aug 2022 20:06:57 +0000 (15:06 -0500)
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. Client driver has changed to use standard
rx_callback, so remove proprietary cmdq_task_cb.

Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
drivers/mailbox/mtk-cmdq-mailbox.c
include/linux/mailbox/mtk-cmdq-mailbox.h

index 2578e5aaa935f25c6b31e6f6251cc6580b192bed..9465f9081515da1d57c2cd178857b75bc761c873 100644 (file)
@@ -192,15 +192,10 @@ static bool cmdq_thread_is_in_wfe(struct cmdq_thread *thread)
 
 static void cmdq_task_exec_done(struct cmdq_task *task, int sta)
 {
-       struct cmdq_task_cb *cb = &task->pkt->async_cb;
        struct cmdq_cb_data data;
 
        data.sta = sta;
-       data.data = cb->data;
        data.pkt = task->pkt;
-       if (cb->cb)
-               cb->cb(data);
-
        mbox_chan_received_data(task->thread->chan, &data);
 
        list_del(&task->list_entry);
@@ -448,7 +443,6 @@ done:
 static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout)
 {
        struct cmdq_thread *thread = (struct cmdq_thread *)chan->con_priv;
-       struct cmdq_task_cb *cb;
        struct cmdq_cb_data data;
        struct cmdq *cmdq = dev_get_drvdata(chan->mbox->dev);
        struct cmdq_task *task, *tmp;
@@ -465,13 +459,8 @@ 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;
                data.sta = -ECONNABORTED;
-               data.data = cb->data;
                data.pkt = task->pkt;
-               if (cb->cb)
-                       cb->cb(data);
-
                mbox_chan_received_data(task->thread->chan, &data);
                list_del(&task->list_entry);
                kfree(task);
index 44365aab043cbfe104ddc57010c8286d9f64981c..a8f0070c7aa98f64c8f2578c88ce7cbd6f7dc426 100644 (file)
@@ -67,24 +67,14 @@ 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);
-
-struct cmdq_task_cb {
-       cmdq_async_flush_cb     cb;
-       void                    *data;
-};
-
 struct cmdq_pkt {
        void                    *va_base;
        dma_addr_t              pa_base;
        size_t                  cmd_buf_size; /* command occupied size */
        size_t                  buf_size; /* real buffer size */
-       struct cmdq_task_cb     cb;
-       struct cmdq_task_cb     async_cb;
        void                    *cl;
 };