Commit a1efec28 authored by Marek Vasut's avatar Marek Vasut

mxssb: Clean up error messages

Use -EINVAL instead of -1 in the error messages.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent 38f413ce
...@@ -1018,7 +1018,6 @@ static int sb_parse_image(struct sb_image_ctx *ictx) ...@@ -1018,7 +1018,6 @@ static int sb_parse_image(struct sb_image_ctx *ictx)
return ret; return ret;
return 0; return 0;
} }
static void sb_free_image(struct sb_image_ctx *ictx) static void sb_free_image(struct sb_image_ctx *ictx)
...@@ -1085,24 +1084,24 @@ int main(int argc, char **argv) ...@@ -1085,24 +1084,24 @@ int main(int argc, char **argv)
break; break;
case 'h': case 'h':
print_help(argv[0]); print_help(argv[0]);
return -1; return -EINVAL;
default: default:
fprintf(stderr, "ERROR: Invalid option '%c'.\n\n", opt); fprintf(stderr, "ERROR: Invalid option '%c'.\n\n", opt);
print_help(argv[0]); print_help(argv[0]);
return -1; return -EINVAL;
} }
} }
if (optind != argc) { if (optind != argc) {
fprintf(stderr, "ERROR: Expected argument after options!\n\n"); fprintf(stderr, "ERROR: Expected argument after options!\n\n");
print_help(argv[0]); print_help(argv[0]);
return -1; return -EINVAL;
} }
if (!ctx.cfg_filename || !output_filename) { if (!ctx.cfg_filename || !output_filename) {
fprintf(stderr, "ERROR: Input files not specified!\n\n"); fprintf(stderr, "ERROR: Input files not specified!\n\n");
print_help(argv[0]); print_help(argv[0]);
return -1; return -EINVAL;
} }
ret = sb_parse_image(&ctx); ret = sb_parse_image(&ctx);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment