mtd: davinci_nand.c: use resource_size()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 14 Dec 2009 21:13:13 +0000 (16:13 -0500)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 31 Dec 2009 19:52:46 +0000 (19:52 +0000)
The ioremap'ed sizes are off by 1; use resource_size() for correct value.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/davinci_nand.c

index fe3eba87de40687225658d2aea50f1760b15de1f..e2eeaf1e51a30920a9f45995288b6b8c78d96c33 100644 (file)
@@ -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;