diff options
author | Jiri Slaby <jirislaby@gmail.com> | 2005-11-07 02:39:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-01-09 15:13:14 -0500 |
commit | cee029538151c0e7bb3cd1c298f222deeecb5ab8 (patch) | |
tree | 1981e1b4d23fa083332ff765ab855bc02472b112 /arch | |
parent | 94517252b7c8e26de7238eb2c1450cb7c69f1af6 (diff) |
[PATCH] PCI: pci_find_device remove (ppc/kernel/pci.c)
Signed-off-by: Jiri Slaby <xslaby@fi.muni.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/ppc/kernel/pci.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
Diffstat (limited to 'arch')
-rw-r--r-- | arch/ppc/kernel/pci.c | 21 |
1 files changed, 11 insertions, 10 deletions
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); |