Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[cascardo/linux.git] / drivers / mtd / nand / orion_nand.c
index f59c074..f4444fe 100644 (file)
@@ -60,7 +60,13 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
        }
        buf64 = (uint64_t *)buf;
        while (i < len/8) {
-               uint64_t x;
+               /*
+                * Since GCC has no proper constraint (PR 43518)
+                * force x variable to r2/r3 registers as ldrd instruction
+                * requires first register to be even.
+                */
+               register uint64_t x asm ("r2");
+
                asm volatile ("ldrd\t%0, [%1]" : "=&r" (x) : "r" (io_base));
                buf64[i++] = x;
        }
@@ -74,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
@@ -89,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;