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

[PATCH] PCI: fixes for pci/probe.c

 - Combine pci_alloc_primary_bus_parented into pci_scan_bus_parented.
 - Move the EXPORT_SYMBOL for pci_root_buses up to its definition.
 - Don't EXPORT_SYMBOL pci_scan_bus since it's a static inline.
 - Add the pci_domain_nr() to the sysfs name for this bus.
parent 02b546b6
...@@ -18,7 +18,10 @@ ...@@ -18,7 +18,10 @@
#define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */ #define CARDBUS_LATENCY_TIMER 176 /* secondary latency timer */
#define CARDBUS_RESERVE_BUSNR 3 #define CARDBUS_RESERVE_BUSNR 3
/* Ugh. Need to stop exporting this to modules. */
LIST_HEAD(pci_root_buses); LIST_HEAD(pci_root_buses);
EXPORT_SYMBOL(pci_root_buses);
LIST_HEAD(pci_devices); LIST_HEAD(pci_devices);
/* /*
...@@ -643,7 +646,7 @@ int __devinit pci_bus_exists(const struct list_head *list, int nr) ...@@ -643,7 +646,7 @@ int __devinit pci_bus_exists(const struct list_head *list, int nr)
return 0; return 0;
} }
static struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent, int bus) struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
{ {
struct pci_bus *b; struct pci_bus *b;
...@@ -663,39 +666,32 @@ static struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device * ...@@ -663,39 +666,32 @@ static struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *
return NULL; return NULL;
} }
b->sysdata = sysdata;
b->ops = ops;
list_add_tail(&b->node, &pci_root_buses); list_add_tail(&b->node, &pci_root_buses);
memset(b->dev,0,sizeof(*(b->dev))); memset(b->dev,0,sizeof(*(b->dev)));
sprintf(b->dev->bus_id,"pci%d",bus);
strcpy(b->dev->name,"Host/PCI Bridge");
b->dev->parent = parent; b->dev->parent = parent;
sprintf(b->dev->bus_id,"pci%04x:%02x", pci_domain_nr(b), bus);
strcpy(b->dev->name,"Host/PCI Bridge");
device_register(b->dev); device_register(b->dev);
b->number = b->secondary = bus; b->number = b->secondary = bus;
b->resource[0] = &ioport_resource; b->resource[0] = &ioport_resource;
b->resource[1] = &iomem_resource; b->resource[1] = &iomem_resource;
return b;
}
struct pci_bus * __devinit pci_scan_bus_parented(struct device *parent, int bus, struct pci_ops *ops, void *sysdata)
{
struct pci_bus *b = pci_alloc_primary_bus_parented(parent, bus);
if (b) {
b->sysdata = sysdata;
b->ops = ops;
b->subordinate = pci_scan_child_bus(b); b->subordinate = pci_scan_child_bus(b);
pci_bus_add_devices(b); pci_bus_add_devices(b);
}
return b; return b;
} }
EXPORT_SYMBOL(pci_scan_bus_parented); EXPORT_SYMBOL(pci_scan_bus_parented);
EXPORT_SYMBOL(pci_root_buses);
#ifdef CONFIG_HOTPLUG #ifdef CONFIG_HOTPLUG
EXPORT_SYMBOL(pci_add_new_bus); EXPORT_SYMBOL(pci_add_new_bus);
EXPORT_SYMBOL(pci_do_scan_bus); EXPORT_SYMBOL(pci_do_scan_bus);
EXPORT_SYMBOL(pci_scan_slot); EXPORT_SYMBOL(pci_scan_slot);
EXPORT_SYMBOL(pci_scan_bus);
EXPORT_SYMBOL(pci_scan_bridge); EXPORT_SYMBOL(pci_scan_bridge);
#endif #endif
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