summaryrefslogtreecommitdiff
path: root/tests/mtd-tests/flash_readtest.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/mtd-tests/flash_readtest.c')
-rw-r--r--tests/mtd-tests/flash_readtest.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tests/mtd-tests/flash_readtest.c b/tests/mtd-tests/flash_readtest.c
index b4f4e10..519ff89 100644
--- a/tests/mtd-tests/flash_readtest.c
+++ b/tests/mtd-tests/flash_readtest.c
@@ -125,10 +125,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);