return child;
}
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus);
/*
* If it's a bridge, configure it and scan the bus behind it.
child->bridge_ctl = bctl;
cmax = pci_scan_child_bus(child);
- if (cmax > max) max = cmax;
+ if (cmax > max)
+ max = cmax;
+ if (child->subordinate > max)
+ max = child->subordinate;
} else {
/*
* We need to assign a number to this bus which we always
return PCI_CFG_SPACE_SIZE;
}
+static void pci_release_bus_bridge_dev(struct device *dev)
+{
+ kfree(dev);
+}
+
/*
* Read the config data for a PCI device, sanity-check it
* and fill in the dev structure...
return NULL;
/* Fix up broken headers */
- pci_fixup_device(PCI_FIXUP_HEADER, dev);
+ pci_fixup_device(pci_fixup_header, dev);
/*
* Add the device to our list of discovered devices
return nr;
}
-static unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
+unsigned int __devinit pci_scan_child_bus(struct pci_bus *bus)
{
unsigned int devfn, pass, max = bus->secondary;
struct pci_dev *dev;
memset(dev, 0, sizeof(*dev));
dev->parent = parent;
+ dev->release = pci_release_bus_bridge_dev;
sprintf(dev->bus_id, "pci%04x:%02x", pci_domain_nr(b), bus);
device_register(dev);
b->bridge = get_device(dev);
EXPORT_SYMBOL(pci_scan_slot);
EXPORT_SYMBOL(pci_scan_bridge);
EXPORT_SYMBOL(pci_scan_single_device);
+EXPORT_SYMBOL_GPL(pci_scan_child_bus);
#endif