diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/nand/orion_nand.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index f59c07427af..990346036d3 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -74,6 +74,7 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
74 | struct mtd_info *mtd; | 74 | struct mtd_info *mtd; |
75 | struct nand_chip *nc; | 75 | struct nand_chip *nc; |
76 | struct orion_nand_data *board; | 76 | struct orion_nand_data *board; |
77 | struct resource *res; | ||
77 | void __iomem *io_base; | 78 | void __iomem *io_base; |
78 | int ret = 0; | 79 | int ret = 0; |
79 | #ifdef CONFIG_MTD_PARTITIONS | 80 | #ifdef CONFIG_MTD_PARTITIONS |
@@ -89,8 +90,13 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
89 | } | 90 | } |
90 | mtd = (struct mtd_info *)(nc + 1); | 91 | mtd = (struct mtd_info *)(nc + 1); |
91 | 92 | ||
92 | io_base = ioremap(pdev->resource[0].start, | 93 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
93 | pdev->resource[0].end - pdev->resource[0].start + 1); | 94 | if (!res) { |
95 | err = -ENODEV; | ||
96 | goto no_res; | ||
97 | } | ||
98 | |||
99 | io_base = ioremap(res->start, resource_size(res)); | ||
94 | if (!io_base) { | 100 | if (!io_base) { |
95 | printk(KERN_ERR "orion_nand: ioremap failed\n"); | 101 | printk(KERN_ERR "orion_nand: ioremap failed\n"); |
96 | ret = -EIO; | 102 | ret = -EIO; |