PCI/portdrv: Remove pcie_port_bus_type link order dependency
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 9 Mar 2018 17:06:56 +0000 (11:06 -0600)
committerBjorn Helgaas <helgaas@kernel.org>
Fri, 30 Mar 2018 22:26:53 +0000 (17:26 -0500)
commitc6c889d932bb49d95273711a790d16f814cb213b
tree306294c899cde6378617876ea0c10f704558e37a
parent79a011194b23302dc43f265ed4237054877768ff
PCI/portdrv: Remove pcie_port_bus_type link order dependency

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: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
drivers/pci/pci-driver.c
drivers/pci/pcie/Makefile
drivers/pci/pcie/portdrv_bus.c [deleted file]
drivers/pci/pcie/portdrv_pci.c