diff options
author | Michael Ellerman <michael@ellerman.id.au> | 2007-09-20 02:36:48 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-10-02 19:11:35 -0400 |
commit | fcbe8090a001522f98ad6f3146f0a1d9fa473821 (patch) | |
tree | 4f60d870a62b2e293103d0bfc45d3e8998ceee45 | |
parent | d9303d662fa3fca8a6d27dee82b961a5f5524f20 (diff) |
[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: Michael Ellerman <michael@ellerman.id.au>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
-rw-r--r-- | arch/powerpc/platforms/pseries/msi.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/pseries/msi.c b/arch/powerpc/platforms/pseries/msi.c index 6063ea2f67ad..9c3bcfe3fe6a 100644 --- a/arch/powerpc/platforms/pseries/msi.c +++ b/arch/powerpc/platforms/pseries/msi.c | |||
@@ -189,29 +189,22 @@ static int rtas_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) | |||
189 | 189 | ||
190 | if (rc != nvec) { | 190 | if (rc != nvec) { |
191 | pr_debug("rtas_msi: rtas_change_msi() failed\n"); | 191 | pr_debug("rtas_msi: rtas_change_msi() failed\n"); |
192 | 192 | return rc; | |
193 | /* | ||
194 | * In case of an error it's not clear whether the device is | ||
195 | * left with MSI enabled or not, so we explicitly disable. | ||
196 | */ | ||
197 | goto out_free; | ||
198 | } | 193 | } |
199 | 194 | ||
200 | i = 0; | 195 | i = 0; |
201 | list_for_each_entry(entry, &pdev->msi_list, list) { | 196 | list_for_each_entry(entry, &pdev->msi_list, list) { |
202 | hwirq = rtas_query_irq_number(pdn, i); | 197 | hwirq = rtas_query_irq_number(pdn, i); |
203 | if (hwirq < 0) { | 198 | if (hwirq < 0) { |
204 | rc = hwirq; | ||
205 | pr_debug("rtas_msi: error (%d) getting hwirq\n", rc); | 199 | pr_debug("rtas_msi: error (%d) getting hwirq\n", rc); |
206 | goto out_free; | 200 | return hwirq; |
207 | } | 201 | } |
208 | 202 | ||
209 | virq = irq_create_mapping(NULL, hwirq); | 203 | virq = irq_create_mapping(NULL, hwirq); |
210 | 204 | ||
211 | if (virq == NO_IRQ) { | 205 | if (virq == NO_IRQ) { |
212 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); | 206 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); |
213 | rc = -ENOSPC; | 207 | return -ENOSPC; |
214 | goto out_free; | ||
215 | } | 208 | } |
216 | 209 | ||
217 | dev_dbg(&pdev->dev, "rtas_msi: allocated virq %d\n", virq); | 210 | 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 | } | 213 | } |
221 | 214 | ||
222 | return 0; | 215 | return 0; |
223 | |||
224 | out_free: | ||
225 | rtas_teardown_msi_irqs(pdev); | ||
226 | return rc; | ||
227 | } | 216 | } |
228 | 217 | ||
229 | static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) | 218 | static void rtas_msi_pci_irq_fixup(struct pci_dev *pdev) |