b077530a8bf9b776921aa960936bc745407b8ae2
[openwrt/staging/hauke.git] /
1 From: Rob Herring <robh@kernel.org>
2 Date: Tue, 3 Aug 2021 15:56:55 -0600
3 Subject: [PATCH] PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing
4 'ranges'
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Commit 669cbc708122 ("PCI: Move DT resource setup into
10 devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on
11 any DT resource parsing errors, but Broadcom iProc uses
12 devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT
13 resources. In particular, there is no 'ranges' property. Fix iProc by
14 making 'ranges' optional.
15
16 If 'ranges' is required by a platform, there's going to be more errors
17 latter on if it is missing.
18
19 Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()")
20 Reported-by: Rafał Miłecki <zajec5@gmail.com>
21 Cc: Srinath Mannam <srinath.mannam@broadcom.com>
22 Cc: Roman Bacik <roman.bacik@broadcom.com>
23 Cc: Bharat Gooty <bharat.gooty@broadcom.com>
24 Cc: Abhishek Shah <abhishek.shah@broadcom.com>
25 Cc: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
26 Cc: Ray Jui <ray.jui@broadcom.com>
27 Cc: Florian Fainelli <f.fainelli@gmail.com>
28 Cc: BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>
29 Cc: Scott Branden <sbranden@broadcom.com>
30 Cc: Bjorn Helgaas <bhelgaas@google.com>
31 Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
32 Signed-off-by: Rob Herring <robh@kernel.org>
33 Acked-by: Bjorn Helgaas <bhelgaas@google.com>
34 ---
35 drivers/pci/of.c | 2 +-
36 1 file changed, 1 insertion(+), 1 deletion(-)
37
38 --- a/drivers/pci/of.c
39 +++ b/drivers/pci/of.c
40 @@ -295,7 +295,7 @@ static int devm_of_pci_get_host_bridge_r
41 /* Check for ranges property */
42 err = of_pci_range_parser_init(&parser, dev_node);
43 if (err)
44 - goto failed;
45 + return 0;
46
47 dev_dbg(dev, "Parsing ranges property...\n");
48 for_each_of_pci_range(&parser, &range) {