diff mbox

omap: mailbox - Enable IRQ after allocating queues

Message ID 1289277892-16854-1-git-send-email-deepak.chitriki@ti.com (mailing list archive)
State New, archived
Delegated to: Hiroshi DOYU
Headers show

Commit Message

Deepak Chitriki Nov. 9, 2010, 4:44 a.m. UTC
None
diff mbox

Patch

diff --git a/arch/arm/plat-omap/mailbox.c b/arch/arm/plat-omap/mailbox.c
index c59c9c3..1513e16 100644
--- a/arch/arm/plat-omap/mailbox.c
+++ b/arch/arm/plat-omap/mailbox.c
@@ -256,14 +256,6 @@  static int omap_mbox_startup(struct omap_mbox *mbox)
 		mutex_unlock(&mbox_configured_lock);
 	}
 
-	ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
-				mbox->name, mbox);
-	if (ret) {
-		printk(KERN_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;
@@ -278,13 +270,21 @@  static int omap_mbox_startup(struct omap_mbox *mbox)
 	}
 	mbox->rxq = mq;
 
+	ret = request_irq(mbox->irq, mbox_interrupt, IRQF_SHARED,
+				mbox->name, mbox);
+	if (ret) {
+		printk(KERN_ERR
+			"failed to register mailbox interrupt:%d\n", ret);
+		goto fail_request_irq;
+	}
+
 	return 0;
 
- fail_alloc_rxq:
+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:
+fail_alloc_txq:
 	if (mbox->ops->shutdown)
 		mbox->ops->shutdown(mbox);