2009-12-14 22:37:18

by Hartley Sweeten

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

Use resource_size().

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

---

diff --git a/drivers/spi/spi_mpc8xxx.c b/drivers/spi/spi_mpc8xxx.c
index 930135d..d72db76 100644
--- a/drivers/spi/spi_mpc8xxx.c
+++ b/drivers/spi/spi_mpc8xxx.c
@@ -1013,7 +1013,7 @@ mpc8xxx_spi_probe(struct device *dev, struct resource *mem, unsigned int irq)

init_completion(&mpc8xxx_spi->done);

- mpc8xxx_spi->base = ioremap(mem->start, mem->end - mem->start + 1);
+ mpc8xxx_spi->base = ioremap(mem->start, resource_size(mem));
if (mpc8xxx_spi->base == NULL) {
ret = -ENOMEM;
goto err_ioremap;