summaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/mailbox.c
diff options
context:
space:
mode:
authorSuman Anna2013-02-02 03:37:06 +0100
committerSuman Anna2013-06-11 18:39:21 +0200
commitecf305cf81c68446508c283015694e304939be5f (patch)
treecc5fdea8fd86506209e86b4ad2c9d2b0f22767c7 /arch/arm/plat-omap/mailbox.c
parentomap: mailbox: check iomem resource before dereferencing it (diff)
downloadkernel-qcow2-linux-ecf305cf81c68446508c283015694e304939be5f.tar.gz
kernel-qcow2-linux-ecf305cf81c68446508c283015694e304939be5f.tar.xz
kernel-qcow2-linux-ecf305cf81c68446508c283015694e304939be5f.zip
omap: mailbox: call request_irq after mbox queues are allocated
The OMAP mailbox startup code is enabling the interrupt before any of the associated mailbox queues are allocated. Move this code so that the interrupt configuration for a mailbox is together. Signed-off-by: Fernando Guzman Lugo <lugo.fernando@gmail.com> Signed-off-by: Suman Anna <s-anna@ti.com>
Diffstat (limited to 'arch/arm/plat-omap/mailbox.c')
-rw-r--r--arch/arm/plat-omap/mailbox.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index 42377ef9ea3d..f65eaf00fce6 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -261,13 +261,6 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
}
if (!mbox->use_count++) {
- ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
- mbox->name, mbox);
- if (unlikely(ret)) {
- pr_err("failed to register mailbox interrupt:%d\n",
- ret);
- goto fail_request_irq;
- }
mq = mbox_queue_alloc(mbox, NULL, mbox_tx_tasklet);
if (!mq) {
ret = -ENOMEM;
@@ -282,17 +275,24 @@ static int omap_mbox_startup(struct omap_mbox *mbox)
}
mbox->rxq = mq;
mq->mbox = mbox;
+ ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
+ mbox->name, mbox);
+ if (unlikely(ret)) {
+ pr_err("failed to register mailbox interrupt:%d\n",
+ ret);
+ goto fail_request_irq;
+ }
omap_mbox_enable_irq(mbox, IRQ_RX);
}
mutex_unlock(&mbox_configured_lock);
return 0;
+fail_request_irq:
+ mbox_queue_free(mbox->rxq);
fail_alloc_rxq:
mbox_queue_free(mbox->txq);
fail_alloc_txq:
- free_irq(mbox->irq, mbox);
-fail_request_irq:
if (mbox->ops->shutdown)
mbox->ops->shutdown(mbox);
mbox->use_count--;