Commit 791c9f14 authored by Daire McNamara's avatar Daire McNamara Committed by Bjorn Helgaas

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.comSigned-off-by: default avatarDaire McNamara <daire.mcnamara@microchip.com>
Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarRob Herring <robh@kernel.org>
parent 7c53f6b6
...@@ -64,6 +64,8 @@ int pci_host_common_probe(struct platform_device *pdev) ...@@ -64,6 +64,8 @@ int pci_host_common_probe(struct platform_device *pdev)
if (!bridge) if (!bridge)
return -ENOMEM; return -ENOMEM;
platform_set_drvdata(pdev, bridge);
of_pci_check_probe_only(); of_pci_check_probe_only();
/* Parse and map our Configuration Space windows */ /* Parse and map our Configuration Space windows */
...@@ -78,8 +80,6 @@ int pci_host_common_probe(struct platform_device *pdev) ...@@ -78,8 +80,6 @@ int pci_host_common_probe(struct platform_device *pdev)
bridge->sysdata = cfg; bridge->sysdata = cfg;
bridge->ops = (struct pci_ops *)&ops->pci_ops; bridge->ops = (struct pci_ops *)&ops->pci_ops;
platform_set_drvdata(pdev, bridge);
return pci_host_probe(bridge); return pci_host_probe(bridge);
} }
EXPORT_SYMBOL_GPL(pci_host_common_probe); EXPORT_SYMBOL_GPL(pci_host_common_probe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment