diff options
Diffstat (limited to 'drivers/mtd/ubi/vtbl.c')
-rw-r--r-- | drivers/mtd/ubi/vtbl.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mtd/ubi/vtbl.c b/drivers/mtd/ubi/vtbl.c index 7a1a8a1da610..2fd9cf4cea7e 100644 --- a/drivers/mtd/ubi/vtbl.c +++ b/drivers/mtd/ubi/vtbl.c | |||
@@ -514,6 +514,17 @@ static int init_volumes(struct ubi_device *ubi, const struct ubi_scan_info *si, | |||
514 | vol->name[vol->name_len] = '\0'; | 514 | vol->name[vol->name_len] = '\0'; |
515 | vol->vol_id = i; | 515 | vol->vol_id = i; |
516 | 516 | ||
517 | if (vtbl[i].flags & UBI_VTBL_AUTORESIZE_FLG) { | ||
518 | /* Auto re-size flag may be set only for one volume */ | ||
519 | if (ubi->autoresize_vol_id != -1) { | ||
520 | ubi_err("more then one auto-resize volume (%d " | ||
521 | "and %d)", ubi->autoresize_vol_id, i); | ||
522 | return -EINVAL; | ||
523 | } | ||
524 | |||
525 | ubi->autoresize_vol_id = i; | ||
526 | } | ||
527 | |||
517 | ubi_assert(!ubi->volumes[i]); | 528 | ubi_assert(!ubi->volumes[i]); |
518 | ubi->volumes[i] = vol; | 529 | ubi->volumes[i] = vol; |
519 | ubi->vol_count += 1; | 530 | ubi->vol_count += 1; |