diff options
author | Daire McNamara <daire.mcnamara@microchip.com> | 2021-01-25 19:29:31 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2021-02-23 23:00:11 +0300 |
commit | 791c9f143c77f847232b46ee9c1c990f60825c8e (patch) | |
tree | bdd93019ec526ce3c456d9d5adafd19da4abb8fb /drivers/pci | |
parent | 7c53f6b671f4aba70ff15e1b05148b10d58c2837 (diff) | |
download | linux-791c9f143c77f847232b46ee9c1c990f60825c8e.tar.xz |
PCI: Call platform_set_drvdata earlier in devm_pci_alloc_host_bridge
Many drivers can now use pci_host_common_probe() directly.
Their hardware window setup can be moved from their 'custom' probe
functions to individual driver init functions.
Link: https://lore.kernel.org/r/20210125162934.5335-2-daire.mcnamara@microchip.com
Signed-off-by: Daire McNamara <daire.mcnamara@microchip.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/controller/pci-host-common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/pci/controller/pci-host-common.c b/drivers/pci/controller/pci-host-common.c index 6ce34a1deecb..6ab694f8d283 100644 --- a/drivers/pci/controller/pci-host-common.c +++ b/drivers/pci/controller/pci-host-common.c @@ -64,6 +64,8 @@ int pci_host_common_probe(struct platform_device *pdev) if (!bridge) return -ENOMEM; + platform_set_drvdata(pdev, bridge); + of_pci_check_probe_only(); /* Parse and map our Configuration Space windows */ @@ -78,8 +80,6 @@ int pci_host_common_probe(struct platform_device *pdev) bridge->sysdata = cfg; bridge->ops = (struct pci_ops *)&ops->pci_ops; - platform_set_drvdata(pdev, bridge); - return pci_host_probe(bridge); } EXPORT_SYMBOL_GPL(pci_host_common_probe); |