@@ -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);