]> git.karo-electronics.de Git - karo-tx-uboot.git/commitdiff
Merge branch 'master' of git://git.denx.de/u-boot-cfi-flash
authorWolfgang Denk <wd@denx.de>
Thu, 30 Apr 2009 20:59:45 +0000 (22:59 +0200)
committerWolfgang Denk <wd@denx.de>
Thu, 30 Apr 2009 20:59:45 +0000 (22:59 +0200)
drivers/mtd/cfi_mtd.c

index 9ac1c86cced3a8d5848c031b153a138cea973211..f03e4fbd728d576dc07dea34a151d86279ef5e82 100644 (file)
@@ -142,22 +142,12 @@ static int cfi_mtd_set_erasesize(struct mtd_info *mtd, flash_info_t *fi)
        int sect_size = 0;
        int sect;
 
+       /*
+        * Select the largest sector size as erasesize (e.g. for UBI)
+        */
        for (sect = 0; sect < fi->sector_count; sect++) {
-               if (!sect_size) {
+               if (flash_sector_size(fi, sect) > sect_size)
                        sect_size = flash_sector_size(fi, sect);
-                       continue;
-               }
-
-               if (sect_size != flash_sector_size(fi, sect)) {
-                       sect_size = 0;
-                       break;
-               }
-       }
-
-       if (!sect_size) {
-               puts("cfi-mtd: devices with multiple sector sizes are"
-                                                       "not supported\n");
-               return -EINVAL;
        }
 
        mtd->erasesize = sect_size;