• Bjorn Helgaas's avatar
    PCI/portdrv: Remove pcie_port_bus_type link order dependency · c6c889d9
    Bjorn Helgaas authored
    The pcie_port_bus_type must be registered before drivers that depend on it
    can be registered.  Those drivers include:
    
      pcied_init()                # PCIe native hotplug driver
      aer_service_init()          # AER driver
      dpc_service_init()          # DPC driver
      pcie_pme_service_init()     # PME driver
    
    Previously we registered pcie_port_bus_type from pcie_portdrv_init(), a
    device_initcall.  The callers of pcie_port_service_register() (above) are
    also device_initcalls.  This is fragile because the device_initcall
    ordering depends on link order, which is not explicit.
    
    Register pcie_port_bus_type from pci_driver_init() along with pci_bus_type.
    This removes the link order dependency between portdrv and the pciehp, AER,
    DPC, and PCIe PME drivers.
    Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
    Reviewed-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    c6c889d9
portdrv_pci.c 6.39 KB