]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
x86/PCI: use for_each_pci_dev()
authorKulikov Vasiliy <segooon@gmail.com>
Sat, 3 Jul 2010 16:04:03 +0000 (20:04 +0400)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Fri, 30 Jul 2010 16:47:33 +0000 (09:47 -0700)
Use for_each_pci_dev() to simplify the code.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
arch/x86/pci/irq.c

index 9810a0f76c91ccd58491e36051678fcf6dd40ad3..f547ee05f7150aa30a1b3f052e22a6e959e17b5d 100644 (file)
@@ -989,7 +989,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign)
        dev_info(&dev->dev, "%s PCI INT %c -> IRQ %d\n", msg, 'A' + pin - 1, irq);
 
        /* Update IRQ for all devices with the same pirq value */
-       while ((dev2 = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev2)) != NULL) {
+       for_each_pci_dev(dev2) {
                pci_read_config_byte(dev2, PCI_INTERRUPT_PIN, &pin);
                if (!pin)
                        continue;
@@ -1028,7 +1028,7 @@ void __init pcibios_fixup_irqs(void)
        u8 pin;
 
        DBG(KERN_DEBUG "PCI: IRQ fixup\n");
-       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       for_each_pci_dev(dev) {
                /*
                 * If the BIOS has set an out of range IRQ number, just
                 * ignore it.  Also keep track of which IRQ's are
@@ -1052,7 +1052,7 @@ void __init pcibios_fixup_irqs(void)
                return;
 
        dev = NULL;
-       while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+       for_each_pci_dev(dev) {
                pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
                if (!pin)
                        continue;