Skip to content

Commit

Permalink
PCI: Call platform_set_drvdata earlier in devm_pci_alloc_host_bridge
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Daire McNamara authored and Bjorn Helgaas committed Feb 23, 2021
1 parent 7c53f6b commit 791c9f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/pci/controller/pci-host-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down

0 comments on commit 791c9f1

Please sign in to comment.