• Russell King's avatar
    [PATCH] Fix up pci_scan_bridge and friends · 7deaf3b8
    Russell King authored
      Now we tackle pci_add_new_bus and pci_scan_bridge.  The hotplug code
      currently uses this, but I'd like it to die off; pci_scan_bridge()
      should be used to scan behind bridges.  This may mean hotplug needs
      some changes to pci_scan_bridge - if so, we need to find out what
      changes are required and fix it.
    
      pci_alloc_child_bus() does what pci_add_new_bus() did, except it
      doesn't attach the new bus to the parents list of child buses.  The
      only way this bus can be reached from the parent bus is by scanning
      the parents devices list, and locating a device with a non-NULL
      subordinate bus.  The only code which should be doing this is the
      PCI code.
    
      Since the new bus will have an empty list head for bus->node, we can
      detect unattached buses prety easily.  (see pci-3.diff.)
    
      pci_scan_bridge() changes slightly - we use our new pci_scan_child_bus()
      function from pci-3.diff, which doesn't attach devices to the global
      tree.  This means callers of pci_scan_child_bus() and pci_scan_bridge()
      (ie, hotplug) will need to call pci_bus_add_devices().
    7deaf3b8
probe.c 17.7 KB