linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs()
@ 2007-09-20  6:36 Michael Ellerman
  2007-09-20  6:36 ` [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs() Michael Ellerman
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Michael Ellerman @ 2007-09-20  6:36 UTC (permalink / raw)
  To: linuxppc-dev

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>
---
 arch/powerpc/sysdev/mpic_u3msi.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c
index 305b864..4e50d1c 100644
--- a/arch/powerpc/sysdev/mpic_u3msi.c
+++ b/arch/powerpc/sysdev/mpic_u3msi.c
@@ -124,7 +124,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)
 {
 	irq_hw_number_t hwirq;
-	int rc;
 	unsigned int virq;
 	struct msi_desc *entry;
 	struct msi_msg msg;
@@ -132,17 +131,15 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	list_for_each_entry(entry, &pdev->msi_list, list) {
 		hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1);
 		if (hwirq < 0) {
-			rc = hwirq;
 			pr_debug("u3msi: failed allocating hwirq\n");
-			goto out_free;
+			return hwirq;
 		}
 
 		virq = irq_create_mapping(msi_mpic->irqhost, hwirq);
 		if (virq == NO_IRQ) {
 			pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq);
 			mpic_msi_free_hwirqs(msi_mpic, hwirq, 1);
-			rc = -ENOSPC;
-			goto out_free;
+			return -ENOSPC;
 		}
 
 		set_irq_msi(virq, entry);
@@ -156,10 +153,6 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
 	}
 
 	return 0;
-
- out_free:
-	u3msi_teardown_msi_irqs(pdev);
-	return rc;
 }
 
 int mpic_u3msi_init(struct mpic *mpic)
-- 
1.5.1.3.g7a33b

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-10-02  8:37 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-20  6:36 [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Michael Ellerman
2007-09-20  6:36 ` [PATCH 2/4] Simplify error logic in rtas_setup_msi_irqs() Michael Ellerman
2007-10-02  5:21   ` Benjamin Herrenschmidt
2007-09-20  6:36 ` [PATCH 3/4] Simplify rtas_change_msi() error semantics Michael Ellerman
2007-10-02  5:23   ` Benjamin Herrenschmidt
2007-10-02  5:58     ` Michael Ellerman
2007-10-02  6:24       ` Benjamin Herrenschmidt
2007-10-02  7:40         ` Michael Ellerman
2007-10-02  8:37           ` Benjamin Herrenschmidt
2007-09-20  6:36 ` [PATCH 4/4] Inline u3msi_compose_msi_msg() Michael Ellerman
2007-10-02  5:24   ` Benjamin Herrenschmidt
2007-10-02  5:21 ` [PATCH 1/4] Simplify error logic in u3msi_setup_msi_irqs() Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).