diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1f5dc78..2762511 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -348,6 +348,12 @@ dev->rom_address = (l == 0xffffffff) ? 0 : l; setup_device(dev, 6); + /* + * If this device is on the root bus, there is no bridge + * to configure, so we can activate it right away. + */ + if (!bus->parent_bus) + pci_register_device(dev); break; case PCI_HEADER_TYPE_BRIDGE: setup_device(dev, 2); @@ -356,6 +362,7 @@ /* inherit parent properties */ child_bus->host = bus->host; child_bus->ops = bus->host->pci_ops; + child_bus->parent_bus = bus; child_bus->resource[PCI_BUS_RESOURCE_MEM] = bus->resource[PCI_BUS_RESOURCE_MEM]; child_bus->resource[PCI_BUS_RESOURCE_MEM_PREF] = diff --git a/include/linux/pci.h b/include/linux/pci.h index 3d0e73b..e422055 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -123,6 +123,7 @@ struct pci_bus { struct pci_controller *host; /* associated host controller */ struct device_d *parent; + struct pci_bus *parent_bus; /* parent bus */ struct list_head node; /* node in list of buses */ struct list_head children; /* list of child buses */ struct list_head devices; /* list of devices on this bus */