X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fwalnut.c;h=ca932122fb6409e213c9a0f551bf7f01c0bac497;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=d6137b1b567025c667a6f4f37361baca533f07bb;hpb=87fc8d1bb10cd459024a742c6a10961fefcef18f;p=linux-2.6.git diff --git a/drivers/mtd/maps/walnut.c b/drivers/mtd/maps/walnut.c index d6137b1b5..ca932122f 100644 --- a/drivers/mtd/maps/walnut.c +++ b/drivers/mtd/maps/walnut.c @@ -1,12 +1,12 @@ /* - * $Id: walnut.c,v 1.2 2004/12/10 12:07:42 holindho Exp $ - * + * $Id: walnut.c,v 1.3 2005/11/07 11:14:29 gleixner Exp $ + * * Mapping for Walnut flash * (used ebony.c as a "framework") - * + * * Heikki Lindholm - * - * + * + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -20,8 +20,6 @@ #include #include #include -#include -#include #include #include #include @@ -48,7 +46,7 @@ static struct mtd_partition walnut_partitions[] = { .name = "OpenBIOS", .offset = 0x0, .size = WALNUT_FLASH_SIZE, - /*.mask_flags = MTD_WRITEABLE, */ /* force read-only */ + /*.mask_flags = MTD_WRITEABLE, */ /* force read-only */ } }; @@ -70,19 +68,21 @@ int __init init_walnut(void) if (WALNUT_FLASH_ONBD_N(fpga_brds1)) { printk("The on-board flash is disabled (U79 sw 5)!"); + iounmap(fpga_status_adr); return -EIO; } - if (WALNUT_FLASH_SRAM_SEL(fpga_brds1)) + if (WALNUT_FLASH_SRAM_SEL(fpga_brds1)) flash_base = WALNUT_FLASH_LOW; else flash_base = WALNUT_FLASH_HIGH; - + walnut_map.phys = flash_base; walnut_map.virt = (void __iomem *)ioremap(flash_base, walnut_map.size); if (!walnut_map.virt) { printk("Failed to ioremap flash.\n"); + iounmap(fpga_status_adr); return -EIO; } @@ -95,9 +95,11 @@ int __init init_walnut(void) ARRAY_SIZE(walnut_partitions)); } else { printk("map probe failed for flash\n"); + iounmap(fpga_status_adr); return -ENXIO; } + iounmap(fpga_status_adr); return 0; }