goto free_hdr;
}
- kernel_len = uheader->ih_size / master->erasesize;
- if (uheader->ih_size % master->erasesize)
- kernel_len++;
-
- kernel_len++;
- kernel_len *= master->erasesize;
+ kernel_len = le32_to_cpu(theader->offsets[1]) +
+ sizeof(struct cybertan_header);
trx_parts[0].name = "u-boot";
trx_parts[0].offset = 0;
trx_parts[2].name = "rootfs";
trx_parts[2].offset = trx_parts[1].offset + trx_parts[1].size;
- trx_parts[2].size = master->size - 6 * master->erasesize - trx_parts[1].size;
+ trx_parts[2].size = master->size - 6 * master->erasesize -
+ trx_parts[1].size;
trx_parts[2].mask_flags = 0;
trx_parts[3].name = "nvram";
*pparts = trx_parts;
ret = TRX_PARTS;
- free_hdr:
+free_hdr:
vfree(header);
- out:
+out:
return ret;
}