Patchwork davinci_nand.c: use resource_size()

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

Comments

hartleys - Dec. 14, 2009, 9:13 p.m.
The ioremap'ed sizes are off by 1, use resource_size() for correct value.

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

---

Patch

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index f13f5b9..b6905f8 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -566,8 +566,8 @@  static int __init nand_davinci_probe(struct platform_device *pdev)
 		goto err_nomem;
 	}
 
-	vaddr = ioremap(res1->start, res1->end - res1->start);
-	base = ioremap(res2->start, res2->end - res2->start);
+	vaddr = ioremap(res1->start, resource_size(res1));
+	base = ioremap(res2->start, resource_size(res2));
 	if (!vaddr || !base) {
 		dev_err(&pdev->dev, "ioremap failed\n");
 		ret = -EINVAL;