flash: print bank usage on failure
[fw/openocd] / src / flash / mflash.c
index ba34422237d10cd3c6ac9e1f6e3a30a59f7e5f96..4a3f8fe21fade48d580813959235ac2ac3c07d40 100644 (file)
@@ -141,7 +141,7 @@ static int s3c2440_set_gpio_to_output (struct mflash_gpio_num gpio)
                gpio_con = S3C2440_GPJCON;
        } else {
                LOG_ERROR("mflash: invalid port %d%s", gpio.num, gpio.port);
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        ret = target_read_u32(target, gpio_con, &data);
@@ -173,7 +173,7 @@ static int s3c2440_set_gpio_output_val (struct mflash_gpio_num gpio, uint8_t val
                gpio_dat = S3C2440_GPJDAT;
        } else {
                LOG_ERROR("mflash: invalid port %d%s", gpio.num, gpio.port);
-               return ERROR_INVALID_ARGUMENTS;
+               return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
        ret = target_read_u32(target, gpio_dat, &data);
@@ -1386,6 +1386,7 @@ static const struct command_registration mflash_config_command_handlers[] = {
                .mode = COMMAND_CONFIG,
                .handler = handle_mflash_init_command,
                .help = "initialize mflash devices",
+               .usage = ""
        },
        COMMAND_REGISTRATION_DONE
 };
@@ -1394,6 +1395,7 @@ static const struct command_registration mflash_command_handler[] = {
                .name = "mflash",
                .mode = COMMAND_ANY,
                .help = "mflash command group",
+               .usage = "",
                .chain = mflash_config_command_handlers,
        },
        COMMAND_REGISTRATION_DONE