]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] PCI: Remove pci_bus_exists
authorMatthew Wilcox <willy@debian.org>
Thu, 3 Jul 2003 08:51:30 +0000 (01:51 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 3 Jul 2003 08:51:30 +0000 (01:51 -0700)
Convert all callers of pci_bus_exists() to call pci_find_bus() instead.
Since all callers of pci_find_bus() are __init or __devinit, mark it as
__devinit too.

arch/i386/pci/legacy.c
arch/sh/kernel/cpu/sh4/pci-sh7751.c
drivers/pci/probe.c
drivers/pci/search.c
include/linux/pci.h

index 29fea7d6ad6c411d44d7ada16246fd3e018c5ba9..71ca3133cdebd58cdc232ed3714c09d71c2ce884 100644 (file)
@@ -28,7 +28,7 @@ static void __devinit pcibios_fixup_peer_bridges(void)
        }
 
        for (n=0; n <= pcibios_last_bus; n++) {
-               if (pci_bus_exists(&pci_root_buses, n))
+               if (pci_find_bus(0, n))
                        continue;
                bus->number = n;
                bus->ops = &pci_root_ops;
index 365c71a4fbe0351e25e3074d6e1d7b46adb4ed8d..0831b1c646acfe9d2fad01f4f5e00db5ce36ef25 100644 (file)
@@ -200,7 +200,7 @@ static void __init pcibios_fixup_peer_bridges(void)
                return;
        PCIDBG(2,"PCI: Peer bridge fixup\n");
        for (n=0; n <= pcibios_last_bus; n++) {
-               if (pci_bus_exists(&pci_root_buses, n))
+               if (pci_find_bus(0, n))
                        continue;
                bus.number = n;
                bus.ops = pci_root_ops;
index 0894f4aed33117c6d985147f574c52cd4187ed8f..af83b3936f6f243c6075d904785da4478c4480cc 100644 (file)
@@ -633,22 +633,11 @@ unsigned int __devinit pci_do_scan_bus(struct pci_bus *bus)
        return max;
 }
 
-int __devinit pci_bus_exists(const struct list_head *list, int nr)
-{
-       const struct pci_bus *b;
-
-       list_for_each_entry(b, list, node) {
-               if (b->number == nr || pci_bus_exists(&b->children, nr))
-                       return 1;
-       }
-       return 0;
-}
-
 struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
 {
        struct pci_bus *b;
 
-       if (pci_bus_exists(&pci_root_buses, bus)) {
+       if (pci_find_bus(0, bus)) {
                /* If we already got to this bus through a different bridge, ignore it */
                DBG("PCI: Bus %02x already known\n", bus);
                return NULL;
index 15c687f743437455297bdf54d0ac329430ad56d7..366f1f16fb2f06e39e94a5add8c6842dbf7cd533 100644 (file)
@@ -7,13 +7,14 @@
  *     Copyright 2003 -- Greg Kroah-Hartman <greg@kroah.com>
  */
 
+#include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/module.h>
 #include <linux/interrupt.h>
 
 spinlock_t pci_bus_lock = SPIN_LOCK_UNLOCKED;
 
-static struct pci_bus *
+static struct pci_bus * __devinit
 pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
 {
        struct pci_bus* child;
@@ -39,7 +40,7 @@ pci_do_find_bus(struct pci_bus* bus, unsigned char busnr)
  * in the global list of PCI buses.  If the bus is found, a pointer to its
  * data structure is returned.  If no bus is found, %NULL is returned.
  */
-struct pci_bus * pci_find_bus(int domain, int busnr)
+struct pci_bus * __devinit pci_find_bus(int domain, int busnr)
 {
        struct pci_bus *bus = NULL;
        struct pci_bus *tmp_bus;
index 72f08971a232a9b22339cd1f9cbda39479bfc3af..a219c58ad88e2804466200f6977d1689c1f881a8 100644 (file)
@@ -544,7 +544,6 @@ void pcibios_update_irq(struct pci_dev *, int irq);
 /* Generic PCI functions used internally */
 
 extern struct pci_bus *pci_find_bus(int domain, int busnr);
-int pci_bus_exists(const struct list_head *list, int nr);
 struct pci_bus *pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata);
 static inline struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
 {