aboutsummaryrefslogtreecommitdiff
path: root/misc-utils/mtdpart.c
diff options
context:
space:
mode:
Diffstat (limited to 'misc-utils/mtdpart.c')
-rw-r--r--misc-utils/mtdpart.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/misc-utils/mtdpart.c b/misc-utils/mtdpart.c
index ba35d87..a341148 100644
--- a/misc-utils/mtdpart.c
+++ b/misc-utils/mtdpart.c
@@ -36,8 +36,10 @@ static void display_help(int status)
" -h, --help Display this help and exit\n"
" -V, --version Output version information and exit\n"
"\n"
+" <MTD_DEVICE> MTD device node or 'mtd:<name>'\n"
+"\n"
"START location and SIZE of the partition are in bytes. They should align on\n"
-"eraseblock size.\n",
+"eraseblock size. If SIZE is 0 the partition will go to end of MTD device.\n",
PROGRAM_NAME
);
exit(status);
@@ -106,7 +108,10 @@ static void process_options(int argc, char * const argv[])
display_help(EXIT_FAILURE);
const char *s_command = argv[optind++];
- mtddev = argv[optind++];
+ mtddev = mtd_find_dev_node(argv[optind]);
+ if (!mtddev)
+ errmsg_die("MTD device not found %s", argv[optind]);
+ optind++;
if (strcmp(s_command, "del") == 0 && (argc - optind) == 1) {
const char *s_part_no = argv[optind++];