- if (find_root(mtd,size,&adm5120_cfe_parts[2])==0) {
- /* entirely jffs2 */
- adm5120_cfe_parts[4].name = NULL;
- adm5120_cfe_parts[2].size = size - adm5120_cfe_parts[2].offset -
- adm5120_cfe_parts[3].size;
- } else {
- /* legacy setup */
- /* calculate leftover flash, and assign it to the jffs2 partition */
- if (cfe_size != 384 * 1024) {
- adm5120_cfe_parts[4].offset = adm5120_cfe_parts[2].offset +
- adm5120_cfe_parts[2].size;
- if ((adm5120_cfe_parts[4].offset % mtd->erasesize) > 0) {
- adm5120_cfe_parts[4].offset += mtd->erasesize -
- (adm5120_cfe_parts[4].offset % mtd->erasesize);
- }
- adm5120_cfe_parts[4].size = adm5120_cfe_parts[3].offset -
- adm5120_cfe_parts[4].offset;
- } else {
- adm5120_cfe_parts[4].offset = adm5120_cfe_parts[2].offset +
- adm5120_cfe_parts[2].size;
- if ((adm5120_cfe_parts[4].offset % mtd->erasesize) > 0) {
- adm5120_cfe_parts[4].offset += mtd->erasesize -
- (adm5120_cfe_parts[4].offset % mtd->erasesize);
- }
- adm5120_cfe_parts[4].size = size - adm5120_cfe_parts[3].size -
- adm5120_cfe_parts[4].offset;
- }
- }
+ find_root(mtd,size,&adm5120_cfe_parts[2]);
+ adm5120_cfe_parts[2].size = size - adm5120_cfe_parts[2].offset - adm5120_cfe_parts[3].size;