[POWERPC] Simplify error logic in u3msi_setup_msi_irqs()

u3msi_setup_msi_irqs() doesn't need to call teardown() itself,
the generic code will do this for us as long as we return a non
zero value.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:
Michael Ellerman 2007-09-20 16:36:47 +10:00 committed by Paul Mackerras
parent db220b234d
commit d9303d662f

View File

@ -125,7 +125,6 @@ static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq,
static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
{ {
irq_hw_number_t hwirq; irq_hw_number_t hwirq;
int rc;
unsigned int virq; unsigned int virq;
struct msi_desc *entry; struct msi_desc *entry;
struct msi_msg msg; struct msi_msg msg;
@ -133,17 +132,15 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
list_for_each_entry(entry, &pdev->msi_list, list) { list_for_each_entry(entry, &pdev->msi_list, list) {
hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1); hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
if (hwirq < 0) { if (hwirq < 0) {
rc = hwirq;
pr_debug("u3msi: failed allocating hwirq\n"); pr_debug("u3msi: failed allocating hwirq\n");
goto out_free; return hwirq;
} }
virq = irq_create_mapping(msi_mpic->irqhost, hwirq); virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
if (virq == NO_IRQ) { if (virq == NO_IRQ) {
pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq); pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq);
mpic_msi_free_hwirqs(msi_mpic, hwirq, 1); mpic_msi_free_hwirqs(msi_mpic, hwirq, 1);
rc = -ENOSPC; return -ENOSPC;
goto out_free;
} }
set_irq_msi(virq, entry); set_irq_msi(virq, entry);
@ -157,10 +154,6 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
} }
return 0; return 0;
out_free:
u3msi_teardown_msi_irqs(pdev);
return rc;
} }
int mpic_u3msi_init(struct mpic *mpic) int mpic_u3msi_init(struct mpic *mpic)