diff options
author | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 2014-02-12 17:57:07 -0500 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2014-02-18 15:33:56 -0500 |
commit | a723e7523c140423ddb450d2ba5c3ba44b003c69 (patch) | |
tree | e532439a77bc7bf45ba8f3b18810aa1e8d57bde3 /drivers/bus/mvebu-mbus.c | |
parent | 4f4bde1df33bde076f53325bdf2c6430cf85e1bb (diff) |
bus: mvebu-mbus: Fix incorrect size for PCI aperture resources
reg[0] is the DT base, reg[1] is the DT length in bytes,
struct resource.end is the inclusive end address, so a -1 is required.
Tested on kirkwood.
Signed-off-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Jason Cooper <jason@lakedaemon.net>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/bus/mvebu-mbus.c')
-rw-r--r-- | drivers/bus/mvebu-mbus.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/bus/mvebu-mbus.c b/drivers/bus/mvebu-mbus.c index 725c46162bbd..2ac754e18bcf 100644 --- a/drivers/bus/mvebu-mbus.c +++ b/drivers/bus/mvebu-mbus.c | |||
@@ -870,14 +870,14 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np, | |||
870 | ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); | 870 | ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg)); |
871 | if (!ret) { | 871 | if (!ret) { |
872 | mem->start = reg[0]; | 872 | mem->start = reg[0]; |
873 | mem->end = mem->start + reg[1]; | 873 | mem->end = mem->start + reg[1] - 1; |
874 | mem->flags = IORESOURCE_MEM; | 874 | mem->flags = IORESOURCE_MEM; |
875 | } | 875 | } |
876 | 876 | ||
877 | ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg)); | 877 | ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg)); |
878 | if (!ret) { | 878 | if (!ret) { |
879 | io->start = reg[0]; | 879 | io->start = reg[0]; |
880 | io->end = io->start + reg[1]; | 880 | io->end = io->start + reg[1] - 1; |
881 | io->flags = IORESOURCE_IO; | 881 | io->flags = IORESOURCE_IO; |
882 | } | 882 | } |
883 | } | 883 | } |