Patchwork fls_upm.c: use resource_size()

login
register
mail settings
Submitter hartleys
Date Dec. 14, 2009, 9:22 p.m.
Message ID <BD79186B4FD85F4B8E60E381CAEE19090200EA4E@mi8nycmail19.Mi8.com>
Download mbox | patch
Permalink /patch/41144/
State New
Headers show

Comments

hartleys - Dec. 14, 2009, 9:22 p.m.
Use resource_size().

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: David Woodhouse <dwmw2@infradead.org>

---

Patch

diff --git a/drivers/mtd/nand/fsl_upm.c b/drivers/mtd/nand/fsl_upm.c
index d120cd8..0b9eaec 100644
--- a/drivers/mtd/nand/fsl_upm.c
+++ b/drivers/mtd/nand/fsl_upm.c
@@ -302,7 +302,7 @@  static int __devinit fun_probe(struct of_device *ofdev,
 				  FSL_UPM_WAIT_WRITE_BYTE;
 
 	fun->io_base = devm_ioremap_nocache(&ofdev->dev, io_res.start,
-					    io_res.end - io_res.start + 1);
+					    resource_size(&io_res));
 	if (!fun->io_base) {
 		ret = -ENOMEM;
 		goto err2;