mtd: nomadik_nand.c: use resource_size()
authorH Hartley Sweeten <hartleys@visionengravers.com>
Mon, 14 Dec 2009 21:36:37 +0000 (16:36 -0500)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 31 Dec 2009 20:47:18 +0000 (20:47 +0000)
Use resource_size().

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

index 66123419f65d4561f4912a60e68d499d9e0406e7..59cbf66607c737de5c9461a18af0045cddb55de2 100644 (file)
@@ -104,21 +104,21 @@ static int nomadik_nand_probe(struct platform_device *pdev)
                ret = -EIO;
                goto err_unmap;
        }
-       host->addr_va = ioremap(res->start, res->end - res->start + 1);
+       host->addr_va = ioremap(res->start, resource_size(res));
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_data");
        if (!res) {
                ret = -EIO;
                goto err_unmap;
        }
-       host->data_va = ioremap(res->start, res->end - res->start + 1);
+       host->data_va = ioremap(res->start, resource_size(res));
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "nand_cmd");
        if (!res) {
                ret = -EIO;
                goto err_unmap;
        }
-       host->cmd_va = ioremap(res->start, res->end - res->start + 1);
+       host->cmd_va = ioremap(res->start, resource_size(res));
 
        if (!host->addr_va || !host->data_va || !host->cmd_va) {
                ret = -ENOMEM;