Skip to content

Commit

Permalink
PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing 'ranges'
Browse files Browse the repository at this point in the history
Commit 669cbc7 ("PCI: Move DT resource setup into
devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on
any DT resource parsing errors, but Broadcom iProc uses
devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT
resources. In particular, there is no 'ranges' property. Fix iProc by
making 'ranges' optional.

If 'ranges' is required by a platform, there's going to be more errors
latter on if it is missing.

Link: https://lore.kernel.org/r/[email protected]
Fixes: 669cbc7 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()")
Reported-by: Rafał Miłecki <[email protected]>
Tested-by: Rafał Miłecki <[email protected]>
Signed-off-by: Rob Herring <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Acked-by: Bjorn Helgaas <[email protected]>
Cc: Srinath Mannam <[email protected]>
Cc: Roman Bacik <[email protected]>
Cc: Bharat Gooty <[email protected]>
Cc: Abhishek Shah <[email protected]>
Cc: Jitendra Bhivare <[email protected]>
Cc: Ray Jui <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: BCM Kernel Feedback <[email protected]>
Cc: Scott Branden <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: Lorenzo Pieralisi <[email protected]>
  • Loading branch information
robherring authored and Lorenzo Pieralisi committed Aug 4, 2021
1 parent e73f0f0 commit d277f6e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/pci/of.c
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev,
/* Check for ranges property */
err = of_pci_range_parser_init(&parser, dev_node);
if (err)
goto failed;
return 0;

dev_dbg(dev, "Parsing ranges property...\n");
for_each_of_pci_range(&parser, &range) {
Expand Down

0 comments on commit d277f6e

Please sign in to comment.