aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bus
diff options
context:
space:
mode:
authorJason Gunthorpe <jgunthorpe@obsidianresearch.com>2013-09-17 16:11:04 -0400
committerJason Cooper <jason@lakedaemon.net>2013-10-01 13:04:17 -0400
commit8553bcad3eca6cdd19c4771c378bd2cf6e25c6b2 (patch)
tree8002c1eca37a2ad3f6a92c53be2ad9fe99b02999 /drivers/bus
parentb643f85814f69306b9a6e0df34a1c8acb97d3bbd (diff)
bus: mvebu-mbus: Fix optional pcie-mem/io-aperture properties
If the property was not specified then the returned resource had a resource_size(..) == 1, rather than 0. The PCI-E driver checks for 0 so it blindly continues on with a corrupted resource. The regression was introduced into v3.12 by: 11be654 PCI: mvebu: Adapt to the new device tree layout Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Signed-off-by: Jason Cooper <jason@lakedaemon.net>
Diffstat (limited to 'drivers/bus')
-rw-r--r--drivers/bus/mvebu-mbus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c
index 553185318963..2394e9753ef5 100644
--- a/drivers/bus/mvebu-mbus.c
+++ b/drivers/bus/mvebu-mbus.c
@@ -865,11 +865,13 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
865 int ret; 865 int ret;
866 866
867 /* 867 /*
868 * These are optional, so we clear them and they'll 868 * These are optional, so we make sure that resource_size(x) will
869 * be zero if they are missing from the DT. 869 * return 0.
870 */ 870 */
871 memset(mem, 0, sizeof(struct resource)); 871 memset(mem, 0, sizeof(struct resource));
872 mem->end = -1;
872 memset(io, 0, sizeof(struct resource)); 873 memset(io, 0, sizeof(struct resource));
874 io->end = -1;
873 875
874 ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); 876 ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
875 if (!ret) { 877 if (!ret) {