+static int rpaphp_pci_config_bridge(struct pci_dev *dev)
+{
+ u8 sec_busno;
+ struct pci_bus *child_bus;
+ struct pci_dev *child_dev;
+
+ dbg("Enter %s: BRIDGE dev=%s\n", __FUNCTION__, pci_name(dev));
+
+ /* get busno of downstream bus */
+ pci_read_config_byte(dev, PCI_SECONDARY_BUS, &sec_busno);
+
+ /* add to children of PCI bridge dev->bus */
+ child_bus = pci_add_new_bus(dev->bus, dev, sec_busno);
+ if (!child_bus) {
+ err("%s: could not add second bus\n", __FUNCTION__);
+ return -EIO;
+ }
+ sprintf(child_bus->name, "PCI Bus #%02x", child_bus->number);
+ /* do pci_scan_child_bus */
+ pci_scan_child_bus(child_bus);
+
+ list_for_each_entry(child_dev, &child_bus->devices, bus_list) {
+ eeh_add_device_late(child_dev);
+ }
+
+ /* fixup new pci devices without touching bus struct */
+ rpaphp_fixup_new_pci_devices(child_bus, 0);
+
+ /* Make the discovered devices available */
+ pci_bus_add_devices(child_bus);
+ return 0;
+}
+
+static void enable_eeh(struct device_node *dn)
+{
+ struct device_node *sib;
+
+ for (sib = dn->child; sib; sib = sib->sibling)
+ enable_eeh(sib);
+ eeh_add_device_early(dn);
+ return;
+
+}
+
+#ifdef DEBUG
+static void print_slot_pci_funcs(struct slot *slot)