Consolidate target selection code into single get_target() that handles both names...
[fw/openocd] / src / flash / mflash.c
index 8913e1662aea1da556d4cd6588c945f843c5499d..5df5261df2800257baa74e039c6f3f49386c8c53 100644 (file)
@@ -795,9 +795,9 @@ static int mflash_bank_command(struct command_context_s *cmd_ctx, char *cmd, cha
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       if ((target = get_target_by_num(strtoul(args[7], NULL, 0))) == NULL)
+       if ((target = get_target(args[7])) == NULL)
        {
-               LOG_ERROR("target %lu not defined", strtoul(args[7], NULL, 0));
+               LOG_ERROR("target '%s' not defined", args[7]);
                return ERROR_FAIL;
        }