From d451bcacaea0a988854ab5c2758009b6dee35419 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 14 Dec 2009 16:48:34 -0500 Subject: [PATCH] --- yaml --- r: 195841 b: refs/heads/master c: e99030609e27abff7e1a868cb56384c678b09984 h: refs/heads/master i: 195839: bf32a9c78871f37a10dc259706195599f651851a v: v3 --- [refs] | 2 +- trunk/drivers/mtd/nand/orion_nand.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 24922d0bf8cb..95f4cb7e54fa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 4442241ef6ed4d53c13d1c4b18fd57918bb4c850 +refs/heads/master: e99030609e27abff7e1a868cb56384c678b09984 diff --git a/trunk/drivers/mtd/nand/orion_nand.c b/trunk/drivers/mtd/nand/orion_nand.c index f59c07427af3..990346036d37 100644 --- a/trunk/drivers/mtd/nand/orion_nand.c +++ b/trunk/drivers/mtd/nand/orion_nand.c @@ -74,6 +74,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 +90,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) { + err = -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;