Commit 8f66ebaf authored by James Bottomley's avatar James Bottomley Committed by Linus Torvalds

allow pci primary busses to have parents in the device model

parent 1ebad6d8
......@@ -548,7 +548,7 @@ int __devinit pci_bus_exists(const struct list_head *list, int nr)
return 0;
}
struct pci_bus * __devinit pci_alloc_primary_bus(int bus)
struct pci_bus * __devinit pci_alloc_primary_bus_parented(struct device *parent, int bus)
{
struct pci_bus *b;
......@@ -567,6 +567,7 @@ struct pci_bus * __devinit pci_alloc_primary_bus(int bus)
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;
device_register(b->dev);
b->number = b->secondary = bus;
......@@ -575,9 +576,9 @@ struct pci_bus * __devinit pci_alloc_primary_bus(int bus)
return b;
}
struct pci_bus * __devinit pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata)
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(bus);
struct pci_bus *b = pci_alloc_primary_bus_parented(parent, bus);
if (b) {
b->sysdata = sysdata;
b->ops = ops;
......
......@@ -558,8 +558,16 @@ void pcibios_fixup_pbus_ranges(struct pci_bus *, struct pbus_set_ranges_data *);
/* Generic PCI functions used internally */
int pci_bus_exists(const struct list_head *list, int nr);
struct pci_bus *pci_scan_bus(int bus, struct pci_ops *ops, void *sysdata);
struct pci_bus *pci_alloc_primary_bus(int bus);
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)
{
return pci_scan_bus_parented(NULL, bus, ops, sysdata);
}
struct pci_bus *pci_alloc_primary_bus_parented(struct device * parent, int bus);
static inline struct pci_bus *pci_alloc_primary_bus(int bus)
{
return pci_alloc_primary_bus_parented(NULL, bus);
}
struct pci_dev *pci_scan_slot(struct pci_dev *temp);
int pci_proc_attach_device(struct pci_dev *dev);
int pci_proc_detach_device(struct pci_dev *dev);
......
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