Commit fed2058e authored by Matthew Wilcox's avatar Matthew Wilcox Committed by Greg Kroah-Hartman

[PATCH] PCI: Remove pci_bus_exists

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.
parent f9cc1da5
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment