diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 21:41:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-09 21:41:42 -0500 |
commit | 977127174a7dff52d17faeeb4c4949a54221881f (patch) | |
tree | b05b9d18a1256d7ed97bdfb537213a8d70ccca57 /arch | |
parent | 80c0531514516e43ae118ddf38424e06e5c3cb3c (diff) | |
parent | 93b47684f60cf25e8cefe19a21d94aa0257fdf36 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/sys_alcor.c | 3 | ||||
-rw-r--r-- | arch/alpha/kernel/sys_sio.c | 6 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-frv.c | 8 | ||||
-rw-r--r-- | arch/frv/mb93090-mb00/pci-irq.c | 4 | ||||
-rw-r--r-- | arch/i386/kernel/scx200.c | 2 | ||||
-rw-r--r-- | arch/i386/pci/acpi.c | 2 | ||||
-rw-r--r-- | arch/i386/pci/fixup.c | 7 | ||||
-rw-r--r-- | arch/i386/pci/irq.c | 42 | ||||
-rw-r--r-- | arch/mips/vr41xx/common/vrc4173.c | 2 | ||||
-rw-r--r-- | arch/ppc/kernel/pci.c | 21 | ||||
-rw-r--r-- | arch/ppc/platforms/85xx/mpc85xx_cds_common.c | 11 | ||||
-rw-r--r-- | arch/sparc64/kernel/ebus.c | 15 |
12 files changed, 64 insertions, 59 deletions
diff --git a/arch/alpha/kernel/sys_alcor.c b/arch/alpha/kernel/sys_alcor.c index 145dcde143ae..d7f0e97fe56f 100644 --- a/arch/alpha/kernel/sys_alcor.c +++ b/arch/alpha/kernel/sys_alcor.c | |||
@@ -254,7 +254,7 @@ alcor_init_pci(void) | |||
254 | * motherboard, by looking for a 21040 TULIP in slot 6, which is | 254 | * motherboard, by looking for a 21040 TULIP in slot 6, which is |
255 | * built into XLT and BRET/MAVERICK, but not available on ALCOR. | 255 | * built into XLT and BRET/MAVERICK, but not available on ALCOR. |
256 | */ | 256 | */ |
257 | dev = pci_find_device(PCI_VENDOR_ID_DEC, | 257 | dev = pci_get_device(PCI_VENDOR_ID_DEC, |
258 | PCI_DEVICE_ID_DEC_TULIP, | 258 | PCI_DEVICE_ID_DEC_TULIP, |
259 | NULL); | 259 | NULL); |
260 | if (dev && dev->devfn == PCI_DEVFN(6,0)) { | 260 | if (dev && dev->devfn == PCI_DEVFN(6,0)) { |
@@ -262,6 +262,7 @@ alcor_init_pci(void) | |||
262 | printk(KERN_INFO "%s: Detected AS500 or XLT motherboard.\n", | 262 | printk(KERN_INFO "%s: Detected AS500 or XLT motherboard.\n", |
263 | __FUNCTION__); | 263 | __FUNCTION__); |
264 | } | 264 | } |
265 | pci_dev_put(dev); | ||
265 | } | 266 | } |
266 | 267 | ||
267 | 268 | ||
diff --git a/arch/alpha/kernel/sys_sio.c b/arch/alpha/kernel/sys_sio.c index 47df48a6ddb7..131a2d9f79d3 100644 --- a/arch/alpha/kernel/sys_sio.c +++ b/arch/alpha/kernel/sys_sio.c | |||
@@ -105,7 +105,7 @@ sio_collect_irq_levels(void) | |||
105 | struct pci_dev *dev = NULL; | 105 | struct pci_dev *dev = NULL; |
106 | 106 | ||
107 | /* Iterate through the devices, collecting IRQ levels. */ | 107 | /* Iterate through the devices, collecting IRQ levels. */ |
108 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 108 | for_each_pci_dev(dev) { |
109 | if ((dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) && | 109 | if ((dev->class >> 16 == PCI_BASE_CLASS_BRIDGE) && |
110 | (dev->class >> 8 != PCI_CLASS_BRIDGE_PCMCIA)) | 110 | (dev->class >> 8 != PCI_CLASS_BRIDGE_PCMCIA)) |
111 | continue; | 111 | continue; |
@@ -229,8 +229,8 @@ alphabook1_init_pci(void) | |||
229 | */ | 229 | */ |
230 | 230 | ||
231 | dev = NULL; | 231 | dev = NULL; |
232 | while ((dev = pci_find_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) { | 232 | while ((dev = pci_get_device(PCI_VENDOR_ID_NCR, PCI_ANY_ID, dev))) { |
233 | if (dev->device == PCI_DEVICE_ID_NCR_53C810 | 233 | if (dev->device == PCI_DEVICE_ID_NCR_53C810 |
234 | || dev->device == PCI_DEVICE_ID_NCR_53C815 | 234 | || dev->device == PCI_DEVICE_ID_NCR_53C815 |
235 | || dev->device == PCI_DEVICE_ID_NCR_53C820 | 235 | || dev->device == PCI_DEVICE_ID_NCR_53C820 |
236 | || dev->device == PCI_DEVICE_ID_NCR_53C825) { | 236 | || dev->device == PCI_DEVICE_ID_NCR_53C825) { |
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c index 83e5489cf039..0a26bf6f1cd4 100644 --- a/arch/frv/mb93090-mb00/pci-frv.c +++ b/arch/frv/mb93090-mb00/pci-frv.c | |||
@@ -142,9 +142,7 @@ static void __init pcibios_allocate_resources(int pass) | |||
142 | u16 command; | 142 | u16 command; |
143 | struct resource *r, *pr; | 143 | struct resource *r, *pr; |
144 | 144 | ||
145 | while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev), | 145 | for_each_pci_dev(dev) { |
146 | dev != NULL | ||
147 | ) { | ||
148 | pci_read_config_word(dev, PCI_COMMAND, &command); | 146 | pci_read_config_word(dev, PCI_COMMAND, &command); |
149 | for(idx = 0; idx < 6; idx++) { | 147 | for(idx = 0; idx < 6; idx++) { |
150 | r = &dev->resource[idx]; | 148 | r = &dev->resource[idx]; |
@@ -188,9 +186,7 @@ static void __init pcibios_assign_resources(void) | |||
188 | int idx; | 186 | int idx; |
189 | struct resource *r; | 187 | struct resource *r; |
190 | 188 | ||
191 | while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev), | 189 | for_each_pci_dev(dev) { |
192 | dev != NULL | ||
193 | ) { | ||
194 | int class = dev->class >> 8; | 190 | int class = dev->class >> 8; |
195 | 191 | ||
196 | /* Don't touch classless devices and host bridges */ | 192 | /* Don't touch classless devices and host bridges */ |
diff --git a/arch/frv/mb93090-mb00/pci-irq.c b/arch/frv/mb93090-mb00/pci-irq.c index 24622d89b1ca..c4a1144c98b0 100644 --- a/arch/frv/mb93090-mb00/pci-irq.c +++ b/arch/frv/mb93090-mb00/pci-irq.c | |||
@@ -48,9 +48,7 @@ void __init pcibios_fixup_irqs(void) | |||
48 | struct pci_dev *dev = NULL; | 48 | struct pci_dev *dev = NULL; |
49 | uint8_t line, pin; | 49 | uint8_t line, pin; |
50 | 50 | ||
51 | while (dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev), | 51 | for_each_pci_dev(dev) { |
52 | dev != NULL | ||
53 | ) { | ||
54 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 52 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
55 | if (pin) { | 53 | if (pin) { |
56 | dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1]; | 54 | dev->irq = pci_bus0_irq_routing[PCI_SLOT(dev->devfn)][pin - 1]; |
diff --git a/arch/i386/kernel/scx200.c b/arch/i386/kernel/scx200.c index 9c968ae67c43..321f5fd26e75 100644 --- a/arch/i386/kernel/scx200.c +++ b/arch/i386/kernel/scx200.c | |||
@@ -143,7 +143,7 @@ static int __init scx200_init(void) | |||
143 | { | 143 | { |
144 | printk(KERN_INFO NAME ": NatSemi SCx200 Driver\n"); | 144 | printk(KERN_INFO NAME ": NatSemi SCx200 Driver\n"); |
145 | 145 | ||
146 | return pci_module_init(&scx200_pci_driver); | 146 | return pci_register_driver(&scx200_pci_driver); |
147 | } | 147 | } |
148 | 148 | ||
149 | static void __exit scx200_cleanup(void) | 149 | static void __exit scx200_cleanup(void) |
diff --git a/arch/i386/pci/acpi.c b/arch/i386/pci/acpi.c index 4c4522b43be5..b33aea845f58 100644 --- a/arch/i386/pci/acpi.c +++ b/arch/i386/pci/acpi.c | |||
@@ -53,7 +53,7 @@ static int __init pci_acpi_init(void) | |||
53 | * don't use pci_enable_device(). | 53 | * don't use pci_enable_device(). |
54 | */ | 54 | */ |
55 | printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n"); | 55 | printk(KERN_INFO "PCI: Routing PCI interrupts for all devices because \"pci=routeirq\" specified\n"); |
56 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) | 56 | for_each_pci_dev(dev) |
57 | acpi_pci_irq_enable(dev); | 57 | acpi_pci_irq_enable(dev); |
58 | } else | 58 | } else |
59 | printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n"); | 59 | printk(KERN_INFO "PCI: If a device doesn't work, try \"pci=routeirq\". If it helps, post a report\n"); |
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index eeb1b1f2d548..65f67070db64 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -413,6 +413,13 @@ static struct dmi_system_id __devinitdata toshiba_ohci1394_dmi_table[] = { | |||
413 | DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"), | 413 | DMI_MATCH(DMI_PRODUCT_VERSION, "PSM4"), |
414 | }, | 414 | }, |
415 | }, | 415 | }, |
416 | { | ||
417 | .ident = "Toshiba A40 based laptop", | ||
418 | .matches = { | ||
419 | DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), | ||
420 | DMI_MATCH(DMI_PRODUCT_VERSION, "PSA40U"), | ||
421 | }, | ||
422 | }, | ||
416 | { } | 423 | { } |
417 | }; | 424 | }; |
418 | 425 | ||
diff --git a/arch/i386/pci/irq.c b/arch/i386/pci/irq.c index ee8e01697d96..e715aa930036 100644 --- a/arch/i386/pci/irq.c +++ b/arch/i386/pci/irq.c | |||
@@ -78,7 +78,7 @@ static inline struct irq_routing_table * pirq_check_routing_table(u8 *addr) | |||
78 | for (i=0; i < rt->size; i++) | 78 | for (i=0; i < rt->size; i++) |
79 | sum += addr[i]; | 79 | sum += addr[i]; |
80 | if (!sum) { | 80 | if (!sum) { |
81 | DBG("PCI: Interrupt Routing Table found at 0x%p\n", rt); | 81 | DBG(KERN_DEBUG "PCI: Interrupt Routing Table found at 0x%p\n", rt); |
82 | return rt; | 82 | return rt; |
83 | } | 83 | } |
84 | return NULL; | 84 | return NULL; |
@@ -128,7 +128,7 @@ static void __init pirq_peer_trick(void) | |||
128 | #ifdef DEBUG | 128 | #ifdef DEBUG |
129 | { | 129 | { |
130 | int j; | 130 | int j; |
131 | DBG("%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); | 131 | DBG(KERN_DEBUG "%02x:%02x slot=%02x", e->bus, e->devfn/8, e->slot); |
132 | for(j=0; j<4; j++) | 132 | for(j=0; j<4; j++) |
133 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); | 133 | DBG(" %d:%02x/%04x", j, e->irq[j].link, e->irq[j].bitmap); |
134 | DBG("\n"); | 134 | DBG("\n"); |
@@ -160,10 +160,10 @@ void eisa_set_level_irq(unsigned int irq) | |||
160 | return; | 160 | return; |
161 | 161 | ||
162 | eisa_irq_mask |= (1 << irq); | 162 | eisa_irq_mask |= (1 << irq); |
163 | printk("PCI: setting IRQ %u as level-triggered\n", irq); | 163 | printk(KERN_DEBUG "PCI: setting IRQ %u as level-triggered\n", irq); |
164 | val = inb(port); | 164 | val = inb(port); |
165 | if (!(val & mask)) { | 165 | if (!(val & mask)) { |
166 | DBG(" -> edge"); | 166 | DBG(KERN_DEBUG " -> edge"); |
167 | outb(val | mask, port); | 167 | outb(val | mask, port); |
168 | } | 168 | } |
169 | } | 169 | } |
@@ -677,11 +677,11 @@ static __init int ali_router_probe(struct irq_router *r, struct pci_dev *router, | |||
677 | { | 677 | { |
678 | case PCI_DEVICE_ID_AL_M1533: | 678 | case PCI_DEVICE_ID_AL_M1533: |
679 | case PCI_DEVICE_ID_AL_M1563: | 679 | case PCI_DEVICE_ID_AL_M1563: |
680 | printk("PCI: Using ALI IRQ Router\n"); | 680 | printk(KERN_DEBUG "PCI: Using ALI IRQ Router\n"); |
681 | r->name = "ALI"; | 681 | r->name = "ALI"; |
682 | r->get = pirq_ali_get; | 682 | r->get = pirq_ali_get; |
683 | r->set = pirq_ali_set; | 683 | r->set = pirq_ali_set; |
684 | return 1; | 684 | return 1; |
685 | } | 685 | } |
686 | return 0; | 686 | return 0; |
687 | } | 687 | } |
@@ -749,12 +749,13 @@ static void __init pirq_find_router(struct irq_router *r) | |||
749 | r->get = NULL; | 749 | r->get = NULL; |
750 | r->set = NULL; | 750 | r->set = NULL; |
751 | 751 | ||
752 | DBG("PCI: Attempting to find IRQ router for %04x:%04x\n", | 752 | DBG(KERN_DEBUG "PCI: Attempting to find IRQ router for %04x:%04x\n", |
753 | rt->rtr_vendor, rt->rtr_device); | 753 | rt->rtr_vendor, rt->rtr_device); |
754 | 754 | ||
755 | pirq_router_dev = pci_find_slot(rt->rtr_bus, rt->rtr_devfn); | 755 | pirq_router_dev = pci_find_slot(rt->rtr_bus, rt->rtr_devfn); |
756 | if (!pirq_router_dev) { | 756 | if (!pirq_router_dev) { |
757 | DBG("PCI: Interrupt router not found at %02x:%02x\n", rt->rtr_bus, rt->rtr_devfn); | 757 | DBG(KERN_DEBUG "PCI: Interrupt router not found at " |
758 | "%02x:%02x\n", rt->rtr_bus, rt->rtr_devfn); | ||
758 | return; | 759 | return; |
759 | } | 760 | } |
760 | 761 | ||
@@ -799,7 +800,7 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
799 | /* Find IRQ pin */ | 800 | /* Find IRQ pin */ |
800 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | 801 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); |
801 | if (!pin) { | 802 | if (!pin) { |
802 | DBG(" -> no interrupt pin\n"); | 803 | DBG(KERN_DEBUG " -> no interrupt pin\n"); |
803 | return 0; | 804 | return 0; |
804 | } | 805 | } |
805 | pin = pin - 1; | 806 | pin = pin - 1; |
@@ -809,16 +810,16 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
809 | if (!pirq_table) | 810 | if (!pirq_table) |
810 | return 0; | 811 | return 0; |
811 | 812 | ||
812 | DBG("IRQ for %s[%c]", pci_name(dev), 'A' + pin); | 813 | DBG(KERN_DEBUG "IRQ for %s[%c]", pci_name(dev), 'A' + pin); |
813 | info = pirq_get_info(dev); | 814 | info = pirq_get_info(dev); |
814 | if (!info) { | 815 | if (!info) { |
815 | DBG(" -> not found in routing table\n"); | 816 | DBG(" -> not found in routing table\n" KERN_DEBUG); |
816 | return 0; | 817 | return 0; |
817 | } | 818 | } |
818 | pirq = info->irq[pin].link; | 819 | pirq = info->irq[pin].link; |
819 | mask = info->irq[pin].bitmap; | 820 | mask = info->irq[pin].bitmap; |
820 | if (!pirq) { | 821 | if (!pirq) { |
821 | DBG(" -> not routed\n"); | 822 | DBG(" -> not routed\n" KERN_DEBUG); |
822 | return 0; | 823 | return 0; |
823 | } | 824 | } |
824 | DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, pirq_table->exclusive_irqs); | 825 | DBG(" -> PIRQ %02x, mask %04x, excl %04x", pirq, mask, pirq_table->exclusive_irqs); |
@@ -848,7 +849,10 @@ static int pcibios_lookup_irq(struct pci_dev *dev, int assign) | |||
848 | newirq = dev->irq; | 849 | newirq = dev->irq; |
849 | if (newirq && !((1 << newirq) & mask)) { | 850 | if (newirq && !((1 << newirq) & mask)) { |
850 | if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; | 851 | if ( pci_probe & PCI_USE_PIRQ_MASK) newirq = 0; |
851 | else printk(KERN_WARNING "PCI: IRQ %i for device %s doesn't match PIRQ mask - try pci=usepirqmask\n", newirq, pci_name(dev)); | 852 | else printk("\n" KERN_WARNING |
853 | "PCI: IRQ %i for device %s doesn't match PIRQ mask " | ||
854 | "- try pci=usepirqmask\n" KERN_DEBUG, newirq, | ||
855 | pci_name(dev)); | ||
852 | } | 856 | } |
853 | if (!newirq && assign) { | 857 | if (!newirq && assign) { |
854 | for (i = 0; i < 16; i++) { | 858 | for (i = 0; i < 16; i++) { |
@@ -923,14 +927,14 @@ static void __init pcibios_fixup_irqs(void) | |||
923 | struct pci_dev *dev = NULL; | 927 | struct pci_dev *dev = NULL; |
924 | u8 pin; | 928 | u8 pin; |
925 | 929 | ||
926 | DBG("PCI: IRQ fixup\n"); | 930 | DBG(KERN_DEBUG "PCI: IRQ fixup\n"); |
927 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 931 | while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { |
928 | /* | 932 | /* |
929 | * If the BIOS has set an out of range IRQ number, just ignore it. | 933 | * If the BIOS has set an out of range IRQ number, just ignore it. |
930 | * Also keep track of which IRQ's are already in use. | 934 | * Also keep track of which IRQ's are already in use. |
931 | */ | 935 | */ |
932 | if (dev->irq >= 16) { | 936 | if (dev->irq >= 16) { |
933 | DBG("%s: ignoring bogus IRQ %d\n", pci_name(dev), dev->irq); | 937 | DBG(KERN_DEBUG "%s: ignoring bogus IRQ %d\n", pci_name(dev), dev->irq); |
934 | dev->irq = 0; | 938 | dev->irq = 0; |
935 | } | 939 | } |
936 | /* If the IRQ is already assigned to a PCI device, ignore its ISA use penalty */ | 940 | /* If the IRQ is already assigned to a PCI device, ignore its ISA use penalty */ |
@@ -1039,7 +1043,7 @@ static struct dmi_system_id __initdata pciirq_dmi_table[] = { | |||
1039 | 1043 | ||
1040 | static int __init pcibios_irq_init(void) | 1044 | static int __init pcibios_irq_init(void) |
1041 | { | 1045 | { |
1042 | DBG("PCI: IRQ init\n"); | 1046 | DBG(KERN_DEBUG "PCI: IRQ init\n"); |
1043 | 1047 | ||
1044 | if (pcibios_enable_irq || raw_pci_ops == NULL) | 1048 | if (pcibios_enable_irq || raw_pci_ops == NULL) |
1045 | return 0; | 1049 | return 0; |
diff --git a/arch/mips/vr41xx/common/vrc4173.c b/arch/mips/vr41xx/common/vrc4173.c index 462a9af30eef..cc52e75e14e7 100644 --- a/arch/mips/vr41xx/common/vrc4173.c +++ b/arch/mips/vr41xx/common/vrc4173.c | |||
@@ -561,7 +561,7 @@ static int __devinit vrc4173_init(void) | |||
561 | { | 561 | { |
562 | int err; | 562 | int err; |
563 | 563 | ||
564 | err = pci_module_init(&vrc4173_driver); | 564 | err = pci_register_driver(&vrc4173_driver); |
565 | if (err < 0) | 565 | if (err < 0) |
566 | return err; | 566 | return err; |
567 | 567 | ||
diff --git a/arch/ppc/kernel/pci.c b/arch/ppc/kernel/pci.c index 50c75eec8874..704c846b2b0f 100644 --- a/arch/ppc/kernel/pci.c +++ b/arch/ppc/kernel/pci.c | |||
@@ -503,7 +503,7 @@ pcibios_allocate_resources(int pass) | |||
503 | u16 command; | 503 | u16 command; |
504 | struct resource *r; | 504 | struct resource *r; |
505 | 505 | ||
506 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 506 | for_each_pci_dev(dev) { |
507 | pci_read_config_word(dev, PCI_COMMAND, &command); | 507 | pci_read_config_word(dev, PCI_COMMAND, &command); |
508 | for (idx = 0; idx < 6; idx++) { | 508 | for (idx = 0; idx < 6; idx++) { |
509 | r = &dev->resource[idx]; | 509 | r = &dev->resource[idx]; |
@@ -540,7 +540,7 @@ pcibios_assign_resources(void) | |||
540 | int idx; | 540 | int idx; |
541 | struct resource *r; | 541 | struct resource *r; |
542 | 542 | ||
543 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 543 | for_each_pci_dev(dev) { |
544 | int class = dev->class >> 8; | 544 | int class = dev->class >> 8; |
545 | 545 | ||
546 | /* Don't touch classless devices and host bridges */ | 546 | /* Don't touch classless devices and host bridges */ |
@@ -867,14 +867,15 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn) | |||
867 | */ | 867 | */ |
868 | if (!pci_to_OF_bus_map) | 868 | if (!pci_to_OF_bus_map) |
869 | return 0; | 869 | return 0; |
870 | while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) { | 870 | |
871 | if (pci_to_OF_bus_map[dev->bus->number] != *bus) | 871 | for_each_pci_dev(dev) |
872 | continue; | 872 | if (pci_to_OF_bus_map[dev->bus->number] == *bus && |
873 | if (dev->devfn != *devfn) | 873 | dev->devfn == *devfn) { |
874 | continue; | 874 | *bus = dev->bus->number; |
875 | *bus = dev->bus->number; | 875 | pci_dev_put(dev); |
876 | return 0; | 876 | return 0; |
877 | } | 877 | } |
878 | |||
878 | return -ENODEV; | 879 | return -ENODEV; |
879 | } | 880 | } |
880 | EXPORT_SYMBOL(pci_device_from_OF_node); | 881 | EXPORT_SYMBOL(pci_device_from_OF_node); |
diff --git a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c index 5e8cc5ec6ab5..2959e3c4083d 100644 --- a/arch/ppc/platforms/85xx/mpc85xx_cds_common.c +++ b/arch/ppc/platforms/85xx/mpc85xx_cds_common.c | |||
@@ -351,10 +351,10 @@ mpc85xx_cds_fixup_via(struct pci_controller *hose) | |||
351 | void __init | 351 | void __init |
352 | mpc85xx_cds_pcibios_fixup(void) | 352 | mpc85xx_cds_pcibios_fixup(void) |
353 | { | 353 | { |
354 | struct pci_dev *dev = NULL; | 354 | struct pci_dev *dev; |
355 | u_char c; | 355 | u_char c; |
356 | 356 | ||
357 | if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, | 357 | if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, |
358 | PCI_DEVICE_ID_VIA_82C586_1, NULL))) { | 358 | PCI_DEVICE_ID_VIA_82C586_1, NULL))) { |
359 | /* | 359 | /* |
360 | * U-Boot does not set the enable bits | 360 | * U-Boot does not set the enable bits |
@@ -371,21 +371,24 @@ mpc85xx_cds_pcibios_fixup(void) | |||
371 | */ | 371 | */ |
372 | dev->irq = 14; | 372 | dev->irq = 14; |
373 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); | 373 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, dev->irq); |
374 | pci_dev_put(dev); | ||
374 | } | 375 | } |
375 | 376 | ||
376 | /* | 377 | /* |
377 | * Force legacy USB interrupt routing | 378 | * Force legacy USB interrupt routing |
378 | */ | 379 | */ |
379 | if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, | 380 | if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, |
380 | PCI_DEVICE_ID_VIA_82C586_2, NULL))) { | 381 | PCI_DEVICE_ID_VIA_82C586_2, NULL))) { |
381 | dev->irq = 10; | 382 | dev->irq = 10; |
382 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10); | 383 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 10); |
384 | pci_dev_put(dev); | ||
383 | } | 385 | } |
384 | 386 | ||
385 | if ((dev = pci_find_device(PCI_VENDOR_ID_VIA, | 387 | if ((dev = pci_get_device(PCI_VENDOR_ID_VIA, |
386 | PCI_DEVICE_ID_VIA_82C586_2, dev))) { | 388 | PCI_DEVICE_ID_VIA_82C586_2, dev))) { |
387 | dev->irq = 11; | 389 | dev->irq = 11; |
388 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11); | 390 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, 11); |
391 | pci_dev_put(dev); | ||
389 | } | 392 | } |
390 | } | 393 | } |
391 | #endif /* CONFIG_PCI */ | 394 | #endif /* CONFIG_PCI */ |
diff --git a/arch/sparc64/kernel/ebus.c b/arch/sparc64/kernel/ebus.c index 6ffbeb701940..7991e919d8ab 100644 --- a/arch/sparc64/kernel/ebus.c +++ b/arch/sparc64/kernel/ebus.c | |||
@@ -527,18 +527,12 @@ static struct pci_dev *find_next_ebus(struct pci_dev *start, int *is_rio_p) | |||
527 | { | 527 | { |
528 | struct pci_dev *pdev = start; | 528 | struct pci_dev *pdev = start; |
529 | 529 | ||
530 | do { | 530 | while ((pdev = pci_get_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev))) |
531 | pdev = pci_find_device(PCI_VENDOR_ID_SUN, PCI_ANY_ID, pdev); | 531 | if (pdev->device == PCI_DEVICE_ID_SUN_EBUS || |
532 | if (pdev && | 532 | pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS) |
533 | (pdev->device == PCI_DEVICE_ID_SUN_EBUS || | ||
534 | pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)) | ||
535 | break; | 533 | break; |
536 | } while (pdev != NULL); | ||
537 | 534 | ||
538 | if (pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)) | 535 | *is_rio_p = !!(pdev && (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS)); |
539 | *is_rio_p = 1; | ||
540 | else | ||
541 | *is_rio_p = 0; | ||
542 | 536 | ||
543 | return pdev; | 537 | return pdev; |
544 | } | 538 | } |
@@ -637,6 +631,7 @@ void __init ebus_init(void) | |||
637 | ebus->is_rio = is_rio; | 631 | ebus->is_rio = is_rio; |
638 | ++num_ebus; | 632 | ++num_ebus; |
639 | } | 633 | } |
634 | pci_dev_put(pdev); /* XXX for the case, when ebusnd is 0, is it OK? */ | ||
640 | 635 | ||
641 | #ifdef CONFIG_SUN_AUXIO | 636 | #ifdef CONFIG_SUN_AUXIO |
642 | auxio_probe(); | 637 | auxio_probe(); |