diff options
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/msi.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 2c1075213bec..aca7578b05e5 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -81,7 +81,10 @@ void default_teardown_msi_irqs(struct pci_dev *dev) | |||
81 | int i, nvec; | 81 | int i, nvec; |
82 | if (entry->irq == 0) | 82 | if (entry->irq == 0) |
83 | continue; | 83 | continue; |
84 | nvec = 1 << entry->msi_attrib.multiple; | 84 | if (entry->nvec_used) |
85 | nvec = entry->nvec_used; | ||
86 | else | ||
87 | nvec = 1 << entry->msi_attrib.multiple; | ||
85 | for (i = 0; i < nvec; i++) | 88 | for (i = 0; i < nvec; i++) |
86 | arch_teardown_msi_irq(entry->irq + i); | 89 | arch_teardown_msi_irq(entry->irq + i); |
87 | } | 90 | } |
@@ -336,7 +339,10 @@ static void free_msi_irqs(struct pci_dev *dev) | |||
336 | int i, nvec; | 339 | int i, nvec; |
337 | if (!entry->irq) | 340 | if (!entry->irq) |
338 | continue; | 341 | continue; |
339 | nvec = 1 << entry->msi_attrib.multiple; | 342 | if (entry->nvec_used) |
343 | nvec = entry->nvec_used; | ||
344 | else | ||
345 | nvec = 1 << entry->msi_attrib.multiple; | ||
340 | #ifdef CONFIG_GENERIC_HARDIRQS | 346 | #ifdef CONFIG_GENERIC_HARDIRQS |
341 | for (i = 0; i < nvec; i++) | 347 | for (i = 0; i < nvec; i++) |
342 | BUG_ON(irq_has_action(entry->irq + i)); | 348 | BUG_ON(irq_has_action(entry->irq + i)); |