diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-09-20 02:36:47 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-02 19:11:32 -0400 |
commit | d9303d662fa3fca8a6d27dee82b961a5f5524f20 (patch) | |
tree | bb6db5c5935bed648c5bbe5451b765e121b2dc4f /arch/powerpc/sysdev/mpic_u3msi.c | |
parent | db220b234da9f183b127b9c3077c253b94756e35 (diff) |
[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>
Diffstat (limited to 'arch/powerpc/sysdev/mpic_u3msi.c')
-rw-r--r-- | 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 0fc4e961d451..255b2f53beda 100644 --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c | |||
@@ -125,7 +125,6 @@ static void u3msi_compose_msi_msg(struct pci_dev *pdev, int virq, | |||
125 | static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | 125 | static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) |
126 | { | 126 | { |
127 | irq_hw_number_t hwirq; | 127 | irq_hw_number_t hwirq; |
128 | int rc; | ||
129 | unsigned int virq; | 128 | unsigned int virq; |
130 | struct msi_desc *entry; | 129 | struct msi_desc *entry; |
131 | struct msi_msg msg; | 130 | struct msi_msg msg; |
@@ -133,17 +132,15 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
133 | list_for_each_entry(entry, &pdev->msi_list, list) { | 132 | list_for_each_entry(entry, &pdev->msi_list, list) { |
134 | hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1); | 133 | hwirq = mpic_msi_alloc_hwirqs(msi_mpic, 1); |
135 | if (hwirq < 0) { | 134 | if (hwirq < 0) { |
136 | rc = hwirq; | ||
137 | pr_debug("u3msi: failed allocating hwirq\n"); | 135 | pr_debug("u3msi: failed allocating hwirq\n"); |
138 | goto out_free; | 136 | return hwirq; |
139 | } | 137 | } |
140 | 138 | ||
141 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); | 139 | virq = irq_create_mapping(msi_mpic->irqhost, hwirq); |
142 | if (virq == NO_IRQ) { | 140 | if (virq == NO_IRQ) { |
143 | pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq); | 141 | pr_debug("u3msi: failed mapping hwirq 0x%lx\n", hwirq); |
144 | mpic_msi_free_hwirqs(msi_mpic, hwirq, 1); | 142 | mpic_msi_free_hwirqs(msi_mpic, hwirq, 1); |
145 | rc = -ENOSPC; | 143 | return -ENOSPC; |
146 | goto out_free; | ||
147 | } | 144 | } |
148 | 145 | ||
149 | set_irq_msi(virq, entry); | 146 | set_irq_msi(virq, entry); |
@@ -157,10 +154,6 @@ static int u3msi_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
157 | } | 154 | } |
158 | 155 | ||
159 | return 0; | 156 | return 0; |
160 | |||
161 | out_free: | ||
162 | u3msi_teardown_msi_irqs(pdev); | ||
163 | return rc; | ||
164 | } | 157 | } |
165 | 158 | ||
166 | int mpic_u3msi_init(struct mpic *mpic) | 159 | int mpic_u3msi_init(struct mpic *mpic) |