summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAnton Altaparmakov <aia21@cantab.net>2005-07-04 13:14:42 (GMT)
committerAnton Altaparmakov <aia21@cantab.net>2005-07-04 13:14:42 (GMT)
commit07929dcb963786512c760dd3ecd148d89295e7e5 (patch)
treef5db01392ebb968b4c8acb5a6b3b03a833bfcb02 /drivers/mtd
parentc2d9b8387bce8b4a0fd402fab7dc1319d11a418d (diff)
parent19f7241a3b087bbf4dd107c979608fdb56c83a09 (diff)
downloadlinux-fsl-qoriq-07929dcb963786512c760dd3ecd148d89295e7e5.tar.xz
Automatic merge with /usr/src/ntfs-2.6.git.
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/afs.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c
index 801e6c7..7363e10 100644
--- a/drivers/mtd/afs.c
+++ b/drivers/mtd/afs.c
@@ -219,7 +219,7 @@ static int parse_afs_partitions(struct mtd_info *mtd,
*/
for (idx = off = 0; off < mtd->size; off += mtd->erasesize) {
struct image_info_struct iis;
- u_int iis_ptr, img_ptr, size;
+ u_int iis_ptr, img_ptr;
/* Read the footer. */
ret = afs_read_footer(mtd, &img_ptr, &iis_ptr, off, mask);
@@ -236,21 +236,9 @@ static int parse_afs_partitions(struct mtd_info *mtd,
continue;
strcpy(str, iis.name);
- size = mtd->erasesize + off - img_ptr;
-
- /*
- * In order to support JFFS2 partitions on this layout,
- * we must lie to MTD about the real size of JFFS2
- * partitions; this ensures that the AFS flash footer
- * won't be erased by JFFS2. Please ensure that your
- * JFFS2 partitions are given image numbers between
- * 1000 and 2000 inclusive.
- */
- if (iis.imageNumber >= 1000 && iis.imageNumber < 2000)
- size -= mtd->erasesize;
parts[idx].name = str;
- parts[idx].size = size;
+ parts[idx].size = (iis.length + mtd->erasesize - 1) & ~(mtd->erasesize - 1);
parts[idx].offset = img_ptr;
parts[idx].mask_flags = 0;