Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a723e752 authored by Jason Gunthorpe's avatar Jason Gunthorpe Committed by Bjorn Helgaas
Browse files

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: default avatarJason Gunthorpe <jgunthorpe@obsidianresearch.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarJason Cooper <jason@lakedaemon.net>
Acked-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 4f4bde1d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -870,14 +870,14 @@ static void __init mvebu_mbus_get_pcie_resources(struct device_node *np,
	ret = of_property_read_u32_array(np, "pcie-mem-aperture", reg, ARRAY_SIZE(reg));
	if (!ret) {
		mem->start = reg[0];
		mem->end = mem->start + reg[1];
		mem->end = mem->start + reg[1] - 1;
		mem->flags = IORESOURCE_MEM;
	}

	ret = of_property_read_u32_array(np, "pcie-io-aperture", reg, ARRAY_SIZE(reg));
	if (!ret) {
		io->start = reg[0];
		io->end = io->start + reg[1];
		io->end = io->start + reg[1] - 1;
		io->flags = IORESOURCE_IO;
	}
}