]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
mailbox: prefix new constants with MBOX_
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Fri, 10 Apr 2026 12:49:12 +0000 (14:49 +0200)
committerJassi Brar <jassisinghbrar@gmail.com>
Mon, 13 Apr 2026 01:04:17 +0000 (20:04 -0500)
Commit 89e5d7d61600 ("mailbox: remove superfluous internal header")
moved some constants to a public header but forgot to add a mailbox
specific prefix. Add this now to prevent future collisions on a too
generic naming.

Link: https://sashiko.dev/#/patchset/20260327151112.5202-2-wsa%2Brenesas%40sang-engineering.com
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Sudeep Holla <sudeep.holla@kernel.org>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/cix-mailbox.c
drivers/mailbox/imx-mailbox.c
drivers/mailbox/mailbox.c
drivers/mailbox/mtk-cmdq-mailbox.c
drivers/mailbox/omap-mailbox.c
drivers/mailbox/tegra-hsp.c
include/linux/mailbox_controller.h

index 8cfaa91b75bd25bd843335802e8d81c52f883901..43c76cdab24a2032ebdd60cf0d0f7b08f901484e 100644 (file)
@@ -413,7 +413,7 @@ static int cix_mbox_startup(struct mbox_chan *chan)
        switch (cp->type) {
        case CIX_MBOX_TYPE_DB:
                /* Overwrite txdone_method for DB channel */
-               chan->txdone_method = TXDONE_BY_ACK;
+               chan->txdone_method = MBOX_TXDONE_BY_ACK;
                fallthrough;
        case CIX_MBOX_TYPE_REG:
                if (priv->dir == CIX_MBOX_TX) {
index 22331b57948941691846864588a1155a2b1a109a..246a9a9e395206759342195f00cac4dd6ef065b0 100644 (file)
@@ -732,7 +732,7 @@ static struct mbox_chan * imx_mu_xlate(struct mbox_controller *mbox,
        p_chan = &mbox->chans[chan];
 
        if (type == IMX_MU_TYPE_TXDB_V2)
-               p_chan->txdone_method = TXDONE_BY_ACK;
+               p_chan->txdone_method = MBOX_TXDONE_BY_ACK;
 
        return p_chan;
 }
index 138ffbcd4fde33befde3a8c45d6081da623922c1..30eafdf3a91ec37377508ff70270352bd238a086 100644 (file)
@@ -72,7 +72,7 @@ static void msg_submit(struct mbox_chan *chan)
                }
        }
 
-       if (!err && (chan->txdone_method & TXDONE_BY_POLL)) {
+       if (!err && (chan->txdone_method & MBOX_TXDONE_BY_POLL)) {
                /* kick start the timer immediately to avoid delays */
                scoped_guard(spinlock_irqsave, &chan->mbox->poll_hrt_lock)
                        hrtimer_start(&chan->mbox->poll_hrt, 0, HRTIMER_MODE_REL);
@@ -162,7 +162,7 @@ EXPORT_SYMBOL_GPL(mbox_chan_received_data);
  */
 void mbox_chan_txdone(struct mbox_chan *chan, int r)
 {
-       if (unlikely(!(chan->txdone_method & TXDONE_BY_IRQ))) {
+       if (unlikely(!(chan->txdone_method & MBOX_TXDONE_BY_IRQ))) {
                dev_err(chan->mbox->dev,
                       "Controller can't run the TX ticker\n");
                return;
@@ -183,7 +183,7 @@ EXPORT_SYMBOL_GPL(mbox_chan_txdone);
  */
 void mbox_client_txdone(struct mbox_chan *chan, int r)
 {
-       if (unlikely(!(chan->txdone_method & TXDONE_BY_ACK))) {
+       if (unlikely(!(chan->txdone_method & MBOX_TXDONE_BY_ACK))) {
                dev_err(chan->mbox->dev, "Client can't run the TX ticker\n");
                return;
        }
@@ -344,8 +344,8 @@ static int __mbox_bind_client(struct mbox_chan *chan, struct mbox_client *cl)
                chan->cl = cl;
                init_completion(&chan->tx_complete);
 
-               if (chan->txdone_method == TXDONE_BY_POLL && cl->knows_txdone)
-                       chan->txdone_method = TXDONE_BY_ACK;
+               if (chan->txdone_method == MBOX_TXDONE_BY_POLL && cl->knows_txdone)
+                       chan->txdone_method = MBOX_TXDONE_BY_ACK;
        }
 
        if (chan->mbox->ops->startup) {
@@ -499,8 +499,8 @@ void mbox_free_channel(struct mbox_chan *chan)
        scoped_guard(spinlock_irqsave, &chan->lock) {
                chan->cl = NULL;
                chan->active_req = MBOX_NO_MSG;
-               if (chan->txdone_method == TXDONE_BY_ACK)
-                       chan->txdone_method = TXDONE_BY_POLL;
+               if (chan->txdone_method == MBOX_TXDONE_BY_ACK)
+                       chan->txdone_method = MBOX_TXDONE_BY_POLL;
        }
 
        module_put(chan->mbox->dev->driver->owner);
@@ -531,13 +531,13 @@ int mbox_controller_register(struct mbox_controller *mbox)
                return -EINVAL;
 
        if (mbox->txdone_irq)
-               txdone = TXDONE_BY_IRQ;
+               txdone = MBOX_TXDONE_BY_IRQ;
        else if (mbox->txdone_poll)
-               txdone = TXDONE_BY_POLL;
+               txdone = MBOX_TXDONE_BY_POLL;
        else /* It has to be ACK then */
-               txdone = TXDONE_BY_ACK;
+               txdone = MBOX_TXDONE_BY_ACK;
 
-       if (txdone == TXDONE_BY_POLL) {
+       if (txdone == MBOX_TXDONE_BY_POLL) {
 
                if (!mbox->ops->last_tx_done) {
                        dev_err(mbox->dev, "last_tx_done method is absent\n");
index 547a10a8fad3ac06d1d5b5ec8839f368d7c444a6..e523c84b48088b427176511415a157aafb91d7e8 100644 (file)
@@ -728,7 +728,7 @@ static int cmdq_probe(struct platform_device *pdev)
        cmdq->mbox.ops = &cmdq_mbox_chan_ops;
        cmdq->mbox.of_xlate = cmdq_xlate;
 
-       /* make use of TXDONE_BY_ACK */
+       /* make use of MBOX_TXDONE_BY_ACK */
        cmdq->mbox.txdone_irq = false;
        cmdq->mbox.txdone_poll = false;
 
index 5772c6b9886a030168322139c18c3deaa2405c8b..535ca8020877d258a9ca0a3a00576f5630619f12 100644 (file)
@@ -238,7 +238,7 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
        }
 
        if (mbox->send_no_irq)
-               mbox->chan->txdone_method = TXDONE_BY_ACK;
+               mbox->chan->txdone_method = MBOX_TXDONE_BY_ACK;
 
        omap_mbox_enable_irq(mbox, IRQ_RX);
 
index 7b1e1b83ea29848dbddcd7c8f0ce4dc34038311d..500fa77c7d53c98c48ce432fc45106167dfd588e 100644 (file)
@@ -514,7 +514,7 @@ static int tegra_hsp_mailbox_startup(struct mbox_chan *chan)
        struct tegra_hsp *hsp = mb->channel.hsp;
        unsigned long flags;
 
-       chan->txdone_method = TXDONE_BY_IRQ;
+       chan->txdone_method = MBOX_TXDONE_BY_IRQ;
 
        /*
         * Shared mailboxes start out as consumers by default. FULL and EMPTY
index e3896b08f22e54169e8f24db7e2bb9c3cbe98420..a49ee687d4cf7b5718cfd07645e9f57f667a1c3f 100644 (file)
@@ -15,9 +15,9 @@ struct mbox_chan;
 /* Sentinel value distinguishing "no active request" from "NULL message data" */
 #define MBOX_NO_MSG    ((void *)-1)
 
-#define TXDONE_BY_IRQ  BIT(0) /* controller has remote RTR irq */
-#define TXDONE_BY_POLL BIT(1) /* controller can read status of last TX */
-#define TXDONE_BY_ACK  BIT(2) /* S/W ACK received by Client ticks the TX */
+#define MBOX_TXDONE_BY_IRQ     BIT(0) /* controller has remote RTR irq */
+#define MBOX_TXDONE_BY_POLL    BIT(1) /* controller can read status of last TX */
+#define MBOX_TXDONE_BY_ACK     BIT(2) /* S/W ACK received by Client ticks the TX */
 
 /**
  * struct mbox_chan_ops - methods to control mailbox channels