diff options
author | Andrew Tridgell <tridge@samba.org> | 2014-01-15 19:27:03 +1100 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-01-15 09:33:58 +0100 |
commit | 778cbcb5cc28240aa1caeae4dd02c2a39567a0e1 (patch) | |
tree | 8eea21cac44f6a86b6fb4009619845a432506053 /src/systemcmds/mtd/mtd.c | |
parent | f3cd83e804e8fffc5e71e4d6443729184b3e7909 (diff) | |
download | px4-firmware-778cbcb5cc28240aa1caeae4dd02c2a39567a0e1.tar.gz px4-firmware-778cbcb5cc28240aa1caeae4dd02c2a39567a0e1.tar.bz2 px4-firmware-778cbcb5cc28240aa1caeae4dd02c2a39567a0e1.zip |
mtd: fixed creation and erase of a single partition
Diffstat (limited to 'src/systemcmds/mtd/mtd.c')
-rw-r--r-- | src/systemcmds/mtd/mtd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/systemcmds/mtd/mtd.c b/src/systemcmds/mtd/mtd.c index 41da63750..5525a8f33 100644 --- a/src/systemcmds/mtd/mtd.c +++ b/src/systemcmds/mtd/mtd.c @@ -108,9 +108,8 @@ int mtd_main(int argc, char *argv[]) if (!strcmp(argv[1], "start")) { /* start mapping according to user request */ - if (argc > 3) { + if (argc >= 3) { mtd_start(argv + 2, argc - 2); - } else { mtd_start(partition_names_default, n_partitions_default); } @@ -123,10 +122,11 @@ int mtd_main(int argc, char *argv[]) mtd_status(); if (!strcmp(argv[1], "erase")) { - if (argc < 3) { - errx(1, "usage: mtd erase <PARTITION_PATH..>"); + if (argc >= 3) { + mtd_erase(argv + 2, argc - 2); + } else { + mtd_erase(partition_names_default, n_partitions_default); } - mtd_erase(argv + 2, argc - 2); } } |