diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2012-05-24 08:52:22 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-07-01 08:18:53 +0200 |
commit | 5f03074ea98b64b55c133b35ee144fdc909e6d69 (patch) | |
tree | 1a61fd84a5a44d98297014486eca663221ff4cbc /arch/nios2 | |
parent | 20addb80f65076b3a81c7d778f7b93d445a96841 (diff) | |
download | barebox-5f03074ea98b64b55c133b35ee144fdc909e6d69.tar.gz barebox-5f03074ea98b64b55c133b35ee144fdc909e6d69.tar.xz |
resource: store 'end' instead of 'size' in struct resource
Storing the size instead of the resource end in struct resource was
a mistake. 'size' ranges from 0 to UINT[32|64]_MAX + 1 which obviously
leads to problems. 'end' on the other hand will never exceed
UINT[32|64]_MAX. Also this way we can express a iomem region covering
the whole address space.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/nios2')
-rw-r--r-- | arch/nios2/boards/generic/generic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/nios2/boards/generic/generic.c b/arch/nios2/boards/generic/generic.c index b51b94afbf..2c998fe3ac 100644 --- a/arch/nios2/boards/generic/generic.c +++ b/arch/nios2/boards/generic/generic.c @@ -9,17 +9,17 @@ static int phy_address = 1; static struct resource mac_resources[] = { [0] = { .start = NIOS_SOPC_TSE_BASE, - .size = 0x400, + .end = NIOS_SOPC_TSE_BASE + 0x400 - 1, .flags = IORESOURCE_MEM, }, [1] = { .start = NIOS_SOPC_SGDMA_RX_BASE, - .size = 0x40, + .end = 0x40 + NIOS_SOPC_SGDMA_RX_BASE - 1, .flags = IORESOURCE_MEM, }, [2] = { .start = NIOS_SOPC_SGDMA_TX_BASE, - .size = 0x40, + .end = 0x40 + NIOS_SOPC_SGDMA_TX_BASE - 1, .flags = IORESOURCE_MEM, }, }; |