PCI: of: Ignore resources with failed translation
authorPavel Fedin <p.fedin@samsung.com>
Thu, 8 Oct 2015 07:24:26 +0000 (10:24 +0300)
committerRob Herring <robh@kernel.org>
Tue, 13 Oct 2015 18:30:42 +0000 (13:30 -0500)
This patch allows PCI host controller to function even if part of resources
is unusable for some reason. An example is non-LPAE kernel on a machine
which has some 64-bit resources. Unusable resources will be just skipped
instead of a complete failure.

Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/of_pci.c

index 5751dc5b6494d41fd0ed9fd88cc877f3d10707a0..ea7c2b6dfc56191876e56b7602934b1c11e963e9 100644 (file)
@@ -223,8 +223,10 @@ int of_pci_get_host_bridge_resources(struct device_node *dev,
                }
 
                err = of_pci_range_to_resource(&range, dev, res);
-               if (err)
-                       goto conversion_failed;
+               if (err) {
+                       kfree(res);
+                       continue;
+               }
 
                if (resource_type(res) == IORESOURCE_IO) {
                        if (!io_base) {