summaryrefslogtreecommitdiffstats
path: root/common/ubiformat.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-04-22 09:02:02 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-04-26 09:24:57 +0200
commitc17e8cf262a16f6038cd6f76f58de031f2317171 (patch)
treec171eed8e60ac7941b646132413993cc1535e765 /common/ubiformat.c
parentb1374a6d97f1211f5c897641668371978eaa592e (diff)
downloadbarebox-c17e8cf262a16f6038cd6f76f58de031f2317171.tar.gz
barebox-c17e8cf262a16f6038cd6f76f58de031f2317171.tar.xz
ubiformat: use default values for ubi_ver and image_seq
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/ubiformat.c')
-rw-r--r--common/ubiformat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/common/ubiformat.c b/common/ubiformat.c
index e4f569b4ec..aaa1f5d6bc 100644
--- a/common/ubiformat.c
+++ b/common/ubiformat.c
@@ -451,6 +451,12 @@ int ubiformat(struct mtd_info *mtd, struct ubiformat_args *args)
struct ubi_scan_info *si;
int ubi_num;
+ if (!args->ubi_ver)
+ args->ubi_ver = 1;
+
+ if (!args->image_seq)
+ args->image_seq = rand();
+
if (!is_power_of_2(mtd->writesize)) {
errmsg("min. I/O size is %d, but should be power of 2",
mtd->writesize);