diff mbox

xilinx_spi.c: use resource_size()

Message ID BD79186B4FD85F4B8E60E381CAEE19090200EA93@mi8nycmail19.Mi8.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Hartley Sweeten Dec. 14, 2009, 10:48 p.m. UTC
None
diff mbox

Patch

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");