diff options
Diffstat (limited to 'drivers/mtd/mtdpart.c')
-rw-r--r-- | drivers/mtd/mtdpart.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 3477e16be1c8..b73720502433 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -479,6 +479,19 @@ static struct mtd_part *allocate_partition(struct mtd_info *master, | |||
479 | (unsigned long long)cur_offset, (unsigned long long)slave->offset); | 479 | (unsigned long long)cur_offset, (unsigned long long)slave->offset); |
480 | } | 480 | } |
481 | } | 481 | } |
482 | if (slave->offset == MTDPART_OFS_RETAIN) { | ||
483 | slave->offset = cur_offset; | ||
484 | if (master->size - slave->offset >= slave->mtd.size) { | ||
485 | slave->mtd.size = master->size - slave->offset | ||
486 | - slave->mtd.size; | ||
487 | } else { | ||
488 | printk(KERN_ERR "mtd partition \"%s\" doesn't have enough space: %#llx < %#llx, disabled\n", | ||
489 | part->name, master->size - slave->offset, | ||
490 | slave->mtd.size); | ||
491 | /* register to preserve ordering */ | ||
492 | goto out_register; | ||
493 | } | ||
494 | } | ||
482 | if (slave->mtd.size == MTDPART_SIZ_FULL) | 495 | if (slave->mtd.size == MTDPART_SIZ_FULL) |
483 | slave->mtd.size = master->size - slave->offset; | 496 | slave->mtd.size = master->size - slave->offset; |
484 | 497 | ||