diff options
Diffstat (limited to 'tests/mtd-tests')
-rw-r--r-- | tests/mtd-tests/flash_readtest.c | 10 | ||||
-rw-r--r-- | tests/mtd-tests/flash_speed.c | 10 | ||||
-rw-r--r-- | tests/mtd-tests/flash_stress.c | 10 | ||||
-rw-r--r-- | tests/mtd-tests/flash_torture.c | 10 |
4 files changed, 28 insertions, 12 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); 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); diff --git a/tests/mtd-tests/flash_stress.c b/tests/mtd-tests/flash_stress.c index b7a0fec..da39e14 100644 --- a/tests/mtd-tests/flash_stress.c +++ b/tests/mtd-tests/flash_stress.c @@ -126,10 +126,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); diff --git a/tests/mtd-tests/flash_torture.c b/tests/mtd-tests/flash_torture.c index 5aad8e0..6363f9e 100644 --- a/tests/mtd-tests/flash_torture.c +++ b/tests/mtd-tests/flash_torture.c @@ -144,10 +144,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); |