diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/mtdpart.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index b92e6bfffaf2..e9168b5cd518 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * | 5 | * |
6 | * This code is GPL | 6 | * This code is GPL |
7 | * | 7 | * |
8 | * $Id: mtdpart.c,v 1.53 2005/02/08 17:11:13 nico Exp $ | 8 | * $Id: mtdpart.c,v 1.54 2005/09/30 14:49:08 dedekind Exp $ |
9 | * | 9 | * |
10 | * 02-21-2002 Thomas Gleixner <gleixner@autronix.de> | 10 | * 02-21-2002 Thomas Gleixner <gleixner@autronix.de> |
11 | * added support for read_oob, write_oob | 11 | * added support for read_oob, write_oob |
@@ -465,9 +465,10 @@ int add_mtd_partitions(struct mtd_info *master, | |||
465 | if (slave->offset == MTDPART_OFS_APPEND) | 465 | if (slave->offset == MTDPART_OFS_APPEND) |
466 | slave->offset = cur_offset; | 466 | slave->offset = cur_offset; |
467 | if (slave->offset == MTDPART_OFS_NXTBLK) { | 467 | if (slave->offset == MTDPART_OFS_NXTBLK) { |
468 | u_int32_t emask = master->erasesize-1; | 468 | slave->offset = cur_offset; |
469 | slave->offset = (cur_offset + emask) & ~emask; | 469 | if ((cur_offset % master->erasesize) != 0) { |
470 | if (slave->offset != cur_offset) { | 470 | /* Round up to next erasesize */ |
471 | slave->offset = ((cur_offset / master->erasesize) + 1) * master->erasesize; | ||
471 | printk(KERN_NOTICE "Moving partition %d: " | 472 | printk(KERN_NOTICE "Moving partition %d: " |
472 | "0x%08x -> 0x%08x\n", i, | 473 | "0x%08x -> 0x%08x\n", i, |
473 | cur_offset, slave->offset); | 474 | cur_offset, slave->offset); |