Consolidate target selection code into single get_target() that handles both names...
[fw/openocd] / src / flash / flash.c
index 4f4d272a4b77f8d240439240d4e627c099531640..ff66a396f557d911639717ef935320670e1c2298 100644 (file)
@@ -261,9 +261,9 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm
                return ERROR_COMMAND_SYNTAX_ERROR;
        }
 
-       if ((target = get_target_by_num(strtoul(args[5], NULL, 0))) == NULL)
+       if ((target = get_target(args[5])) == NULL)
        {
-               LOG_ERROR("target %lu not defined", strtoul(args[5], NULL, 0));
+               LOG_ERROR("target '%s' not defined", args[5]);
                return ERROR_FAIL;
        }