]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/blobdiff - drivers/mtd/nand/orion_nand.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[lisovros/linux_canprio.git] / drivers / mtd / nand / orion_nand.c
index d60fc5719fef33e29ff29e970aadc735a00f40de..f4444fe960a1a5553b56e7120d2dbb0d102c14d1 100644 (file)
@@ -80,6 +80,7 @@ static int __init orion_nand_probe(struct platform_device *pdev)
        struct mtd_info *mtd;
        struct nand_chip *nc;
        struct orion_nand_data *board;
+       struct resource *res;
        void __iomem *io_base;
        int ret = 0;
 #ifdef CONFIG_MTD_PARTITIONS
@@ -95,8 +96,13 @@ static int __init orion_nand_probe(struct platform_device *pdev)
        }
        mtd = (struct mtd_info *)(nc + 1);
 
-       io_base = ioremap(pdev->resource[0].start,
-                       pdev->resource[0].end - pdev->resource[0].start + 1);
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       if (!res) {
+               ret = -ENODEV;
+               goto no_res;
+       }
+
+       io_base = ioremap(res->start, resource_size(res));
        if (!io_base) {
                printk(KERN_ERR "orion_nand: ioremap failed\n");
                ret = -EIO;