summaryrefslogtreecommitdiff
path: root/tests/mtd-tests/flash_speed.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mtd-tests/flash_speed.c')
-rw-r--r--tests/mtd-tests/flash_speed.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/mtd-tests/flash_speed.c b/tests/mtd-tests/flash_speed.c
index 0f82047..5721dfb 100644
--- a/tests/mtd-tests/flash_speed.c
+++ b/tests/mtd-tests/flash_speed.c
@@ -141,10 +141,14 @@ static void process_options(int argc, char **argv)
}
}
- if (optind < argc)
- mtddev = argv[optind++];
- else
+ if (optind < argc) {
+ mtddev = mtd_find_dev_node(argv[optind]);
+ if (!mtddev)
+ errmsg_die("Can't find MTD device %s", argv[optind]);
+ optind++;
+ } else {
errmsg_die("No device specified!\n");
+ }
if (optind < argc)
usage(EXIT_FAILURE);