X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Fmtd%2Fmaps%2Fts5500_flash.c;h=a7422c200567d8afd583b201745b13db2c81a102;hb=d8b3d7077d08311552643a220f21ce0d30130f59;hp=3ebd90f5650331e730ea7d9bdf8b71e470ed7ae3;hpb=207e0a826fdee4bfe853681aef2175a739c11286;p=linux-2.6.git diff --git a/drivers/mtd/maps/ts5500_flash.c b/drivers/mtd/maps/ts5500_flash.c index 3ebd90f56..a7422c200 100644 --- a/drivers/mtd/maps/ts5500_flash.c +++ b/drivers/mtd/maps/ts5500_flash.c @@ -19,26 +19,22 @@ * * Note: * - In order for detection to work, jumper 3 must be set. - * - Drive A and B use a proprietary FTL from General Software which isn't - * supported as of yet so standard drives can't be mounted; you can create - * your own (e.g. jffs) file system. - * - If you have created your own jffs file system and the bios overwrites + * - Drive A and B use the resident flash disk (RFD) flash translation layer. + * - If you have created your own jffs file system and the bios overwrites * it during boot, try disabling Drive A: and B: in the boot order. * - * $Id: ts5500_flash.c,v 1.2 2004/11/28 09:40:40 dwmw2 Exp $ + * $Id: ts5500_flash.c,v 1.5 2005/11/07 11:14:28 gleixner Exp $ */ #include +#include #include -#include #include -#include -#include #include - -#ifdef CONFIG_MTD_PARTITIONS +#include #include -#endif +#include + #define WINDOW_ADDR 0x09400000 #define WINDOW_SIZE 0x00200000 @@ -50,7 +46,6 @@ static struct map_info ts5500_map = { .phys = WINDOW_ADDR }; -#ifdef CONFIG_MTD_PARTITIONS static struct mtd_partition ts5500_partitions[] = { { .name = "Drive A", @@ -69,9 +64,7 @@ static struct mtd_partition ts5500_partitions[] = { } }; -#define NUM_PARTITIONS (sizeof(ts5500_partitions)/sizeof(struct mtd_partition)) - -#endif +#define NUM_PARTITIONS ARRAY_SIZE(ts5500_partitions) static struct mtd_info *mymtd; @@ -81,48 +74,39 @@ static int __init init_ts5500_map(void) ts5500_map.virt = ioremap_nocache(ts5500_map.phys, ts5500_map.size); - if(!ts5500_map.virt) { + if (!ts5500_map.virt) { printk(KERN_ERR "Failed to ioremap_nocache\n"); rc = -EIO; - goto err_out_ioremap; + goto err2; } simple_map_init(&ts5500_map); mymtd = do_map_probe("jedec_probe", &ts5500_map); - if(!mymtd) + if (!mymtd) mymtd = do_map_probe("map_rom", &ts5500_map); - if(!mymtd) { + if (!mymtd) { rc = -ENXIO; - goto err_out_map; + goto err1; } mymtd->owner = THIS_MODULE; -#ifdef CONFIG_MTD_PARTITIONS add_mtd_partitions(mymtd, ts5500_partitions, NUM_PARTITIONS); -#else - add_mtd_device(mymtd); -#endif return 0; -err_out_map: +err1: map_destroy(mymtd); -err_out_ioremap: iounmap(ts5500_map.virt); - +err2: return rc; } static void __exit cleanup_ts5500_map(void) { if (mymtd) { -#ifdef CONFIG_MTD_PARTITIONS del_mtd_partitions(mymtd); -#else - del_mtd_device(mymtd); -#endif map_destroy(mymtd); }