mailbox/omap: remove omap_mbox_type_t from mailbox ops
authorSuman Anna <s-anna@ti.com>
Wed, 25 Jun 2014 00:43:39 +0000 (19:43 -0500)
committerTony Lindgren <tony@atomide.com>
Tue, 29 Jul 2014 08:57:25 +0000 (01:57 -0700)
The type definition omap_mbox_type_t used for distinguishing
OMAP1 from OMAP2+ mailboxes is no longer needed after the
removal of OMAP1 mailbox driver, and has therefore been
cleaned up. This cleanup also eliminates the need for the
polling logic used for checking the transmit readiness.

Signed-off-by: Suman Anna <s-anna@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
drivers/mailbox/mailbox-omap2.c
drivers/mailbox/omap-mailbox.c
drivers/mailbox/omap-mbox.h

index 75fbc9072d01f135397a5e603755dfbb2e777b5d..b44e3bcff62ae4b919a54d0dba933f83e007d3d8 100644 (file)
@@ -205,7 +205,6 @@ static void omap2_mbox_restore_ctx(struct omap_mbox *mbox)
 }
 
 static struct omap_mbox_ops omap2_mbox_ops = {
-       .type           = OMAP_MBOX_TYPE2,
        .startup        = omap2_mbox_startup,
        .shutdown       = omap2_mbox_shutdown,
        .fifo_read      = omap2_mbox_fifo_read,
index d79a646b9042cde5786e87ded1b9d51a2093feb1..eab72276ffab1123a6e96267270e88efcc06b658 100644 (file)
@@ -24,7 +24,6 @@
 #include <linux/interrupt.h>
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
-#include <linux/delay.h>
 #include <linux/slab.h>
 #include <linux/kfifo.h>
 #include <linux/err.h>
@@ -74,20 +73,6 @@ static inline int is_mbox_irq(struct omap_mbox *mbox, omap_mbox_irq_t irq)
 /*
  * message sender
  */
-static int __mbox_poll_for_space(struct omap_mbox *mbox)
-{
-       int ret = 0, i = 1000;
-
-       while (mbox_fifo_full(mbox)) {
-               if (mbox->ops->type == OMAP_MBOX_TYPE2)
-                       return -1;
-               if (--i == 0)
-                       return -1;
-               udelay(1);
-       }
-       return ret;
-}
-
 int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
 {
        struct omap_mbox_queue *mq = mbox->txq;
@@ -100,7 +85,7 @@ int omap_mbox_msg_send(struct omap_mbox *mbox, mbox_msg_t msg)
                goto out;
        }
 
-       if (kfifo_is_empty(&mq->fifo) && !__mbox_poll_for_space(mbox)) {
+       if (kfifo_is_empty(&mq->fifo) && !mbox_fifo_full(mbox)) {
                mbox_fifo_write(mbox, msg);
                goto out;
        }
@@ -158,7 +143,7 @@ static void mbox_tx_tasklet(unsigned long tx_data)
        int ret;
 
        while (kfifo_len(&mq->fifo)) {
-               if (__mbox_poll_for_space(mbox)) {
+               if (mbox_fifo_full(mbox)) {
                        omap_mbox_enable_irq(mbox, IRQ_TX);
                        break;
                }
@@ -223,9 +208,6 @@ static void __mbox_rx_interrupt(struct omap_mbox *mbox)
 
                len = kfifo_in(&mq->fifo, (unsigned char *)&msg, sizeof(msg));
                WARN_ON(len != sizeof(msg));
-
-               if (mbox->ops->type == OMAP_MBOX_TYPE1)
-                       break;
        }
 
        /* no more messages in the fifo. clear IRQ source. */
index 86d7518cd13b2c07b27b6931042e1d3c7b10529d..fae215195590cd47f4fca6346349c6f7e0e5dedb 100644 (file)
 #include <linux/workqueue.h>
 #include <linux/omap-mailbox.h>
 
-typedef int __bitwise omap_mbox_type_t;
-#define OMAP_MBOX_TYPE1 ((__force omap_mbox_type_t) 1)
-#define OMAP_MBOX_TYPE2 ((__force omap_mbox_type_t) 2)
-
 struct omap_mbox_ops {
-       omap_mbox_type_t        type;
        int             (*startup)(struct omap_mbox *mbox);
        void            (*shutdown)(struct omap_mbox *mbox);
        /* fifo */