]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/mtd/nand/nomadik_nand.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[net-next-2.6.git] / drivers / mtd / nand / nomadik_nand.c
index 66123419f65d4561f4912a60e68d499d9e0406e7..8c0b69375224cd9cda762f90b223a66b697620bc 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/platform_device.h>
 #include <linux/mtd/partitions.h>
 #include <linux/io.h>
+#include <linux/slab.h>
 #include <mach/nand.h>
 #include <mach/fsmc.h>
 
@@ -104,21 +105,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;