mtd: davinci_nand.c: use resource_size()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Dec 31 15:59:01 EST 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=d8bc55553c416c877267c1efd65b099164acbe3f
Commit:     d8bc55553c416c877267c1efd65b099164acbe3f
Parent:     440d4f9fb62dad0d5ed1635d099cedaa7a25d96d
Author:     H Hartley Sweeten <hartleys at visionengravers.com>
AuthorDate: Mon Dec 14 16:13:13 2009 -0500
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Dec 31 19:52:46 2009 +0000

    mtd: davinci_nand.c: use resource_size()
    
    The ioremap'ed sizes are off by 1; use resource_size() for correct value.
    
    Signed-off-by: H Hartley Sweeten <hsweeten at visionengravers.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/davinci_nand.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index fe3eba8..e2eeaf1 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;



More information about the linux-mtd-cvs mailing list