Commit fcbe8090 authored by Michael Ellerman's avatar Michael Ellerman Committed by Paul Mackerras

[POWERPC] Simplify error logic in rtas_setup_msi_irqs()

rtas_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: default avatarMichael Ellerman <michael@ellerman.id.au>
Acked-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent d9303d66
...@@ -189,29 +189,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) ...@@ -189,29 +189,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
if (rc != nvec) { if (rc != nvec) {
pr_debug("rtas_msi: rtas_change_msi() failed\n"); pr_debug("rtas_msi: rtas_change_msi() failed\n");
return rc;
/*
* In case of an error it's not clear whether the device is
* left with MSI enabled or not, so we explicitly disable.
*/
goto out_free;
} }
i = 0; i = 0;
list_for_each_entry(entry, &pdev->msi_list, list) { list_for_each_entry(entry, &pdev->msi_list, list) {
hwirq = rtas_query_irq_number(pdn, i); hwirq = rtas_query_irq_number(pdn, i);
if (hwirq < 0) { if (hwirq < 0) {
rc = hwirq;
pr_debug("rtas_msi: error (%d) getting hwirq\n", rc); pr_debug("rtas_msi: error (%d) getting hwirq\n", rc);
goto out_free; return hwirq;
} }
virq = irq_create_mapping(NULL, hwirq); virq = irq_create_mapping(NULL, hwirq);
if (virq == NO_IRQ) { if (virq == NO_IRQ) {
pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq);
rc = -ENOSPC; return -ENOSPC;
goto out_free;
} }
dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq);
...@@ -220,10 +213,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) ...@@ -220,10 +213,6 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
} }
return 0; return 0;
out_free:
rtas_teardown_msi_irqs(pdev);
return rc;
} }
static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment