Skip to content

Commit 791c9f1

Browse files
Daire McNamarabjorn-helgaas
authored andcommitted
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>
1 parent 7c53f6b commit 791c9f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/controller/pci-host-common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ int pci_host_common_probe(struct platform_device *pdev)
6464
if (!bridge)
6565
return -ENOMEM;
6666

67+
platform_set_drvdata(pdev, bridge);
68+
6769
of_pci_check_probe_only();
6870

6971
/* Parse and map our Configuration Space windows */
@@ -78,8 +80,6 @@ int pci_host_common_probe(struct platform_device *pdev)
7880
bridge->sysdata = cfg;
7981
bridge->ops = (struct pci_ops *)&ops->pci_ops;
8082

81-
platform_set_drvdata(pdev, bridge);
82-
8383
return pci_host_probe(bridge);
8484
}
8585
EXPORT_SYMBOL_GPL(pci_host_common_probe);

0 commit comments

Comments
 (0)