]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/command.c
Add cmd_process_error() to report and process errors
[people/ms/u-boot.git] / common / command.c
index 597ab4cb4d83493e1c90d96a85da0669a48a4b8a..26c37f2b9d931373b59a9e59cacaa0b83829a1fa 100644 (file)
@@ -538,3 +538,13 @@ enum command_ret_t cmd_process(int flag, int argc, char * const argv[],
                rc = cmd_usage(cmdtp);
        return rc;
 }
+
+int cmd_process_error(cmd_tbl_t *cmdtp, int err)
+{
+       if (err) {
+               printf("Command '%s' failed: Error %d\n", cmdtp->name, err);
+               return 1;
+       }
+
+       return 0;
+}