aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
authorMichael Ellerman <michael@ellerman.id.au>2007-03-22 06:51:27 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-05-02 22:02:36 -0400
commit54bc6c0b0edd164fc2ea85b3964736c182f6bd5d (patch)
tree958b49ca0af3c6616916bd99fa591e36fb3b7c8c /drivers/pci/msi.c
parente387b9eefe89a23245f2446f947529cce5d6db35 (diff)
MSI: Simplify BUG() handling in pci_disable_msix()
Although it might be nice to do a printk before BUG'ing, it's really not necessary, and it complicates the code. The behaviour has changed slightly, in that before we set a flag if the irq had an action, and continued freeing the other irqs. But as I see it that's all irrelevant because we end up BUG'ing anyway. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Acked-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 9213c57cd968..db452319be90 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -676,7 +676,7 @@ int pci_enable_msix(struct pci_dev* dev, struct msix_entry *entries, int nvec)
676 676
677void pci_disable_msix(struct pci_dev* dev) 677void pci_disable_msix(struct pci_dev* dev)
678{ 678{
679 int irq, head, tail = 0, warning = 0; 679 int irq, head, tail = 0;
680 680
681 if (!pci_msi_enable) 681 if (!pci_msi_enable)
682 return; 682 return;
@@ -693,19 +693,14 @@ void pci_disable_msix(struct pci_dev* dev)
693 irq = head = dev->first_msi_irq; 693 irq = head = dev->first_msi_irq;
694 while (head != tail) { 694 while (head != tail) {
695 tail = get_irq_msi(irq)->link.tail; 695 tail = get_irq_msi(irq)->link.tail;
696 if (irq_has_action(irq)) 696
697 warning = 1; 697 BUG_ON(irq_has_action(irq));
698 else if (irq != head) /* Release MSI-X irq */ 698
699 if (irq != head) /* Release MSI-X irq */
699 msi_free_irq(dev, irq); 700 msi_free_irq(dev, irq);
700 irq = tail; 701 irq = tail;
701 } 702 }
702 msi_free_irq(dev, irq); 703 msi_free_irq(dev, irq);
703 if (warning) {
704 printk(KERN_WARNING "PCI: %s: pci_disable_msix() called without "
705 "free_irq() on all MSI-X irqs\n",
706 pci_name(dev));
707 BUG_ON(warning > 0);
708 }
709 dev->first_msi_irq = 0; 704 dev->first_msi_irq = 0;
710} 705}
711 706