2009-12-14 22:49:01

by Hartley Sweeten

[permalink] [raw]
Subject: [PATCH] xilinx_spi.c: use resource_size()

Use resource_size().

Signed-off-by: H Hartley Sweeten <[email protected]>
Cc: David Brownell <[email protected]>

---

diff --git a/drivers/spi/xilinx_spi.c b/drivers/spi/xilinx_spi.c
index 5a143b9..32525e6 100644
--- a/drivers/spi/xilinx_spi.c
+++ b/drivers/spi/xilinx_spi.c
@@ -332,14 +332,14 @@ static int __init xilinx_spi_of_probe(struct of_device *ofdev,

xspi->irq = r_irq->start;

- if (!request_mem_region(r_mem->start,
- r_mem->end - r_mem->start + 1, XILINX_SPI_NAME)) {
+ if (!request_mem_region(r_mem->start, resource_size(r_mem),
+ XILINX_SPI_NAME)) {
rc = -ENXIO;
dev_warn(&ofdev->dev, "memory request failure\n");
goto put_master;
}

- xspi->regs = ioremap(r_mem->start, r_mem->end - r_mem->start + 1);
+ xspi->regs = ioremap(r_mem->start, resource_size(r_mem));
if (xspi->regs == NULL) {
rc = -ENOMEM;
dev_warn(&ofdev->dev, "ioremap failure\n");


2009-12-14 23:36:21

by Hartley Sweeten

[permalink] [raw]
Subject: RE: [spi-devel-general] [PATCH] xilinx_spi.c: use resource_size()

On Monday, December 14, 2009 3:49 PM, H Hartley Sweeten wrote:
> Use resource_size().
>
> Signed-off-by: H Hartley Sweeten <[email protected]>
> Cc: David Brownell <[email protected]>

Please ignore. An update to this driver just got merged that
handles this.

Sorry for the noise,
Hartley