Consolidate target selection code into single get_target() that handles both names...
[fw/openocd] / src / flash / lpc3180_nand_controller.c
index 50846b92b261271ce953fe1782924f1b68be7c86..1cbd92043ebf48f17cfcb246d2997f4fa82547c2 100644 (file)
@@ -71,10 +71,10 @@ static int lpc3180_nand_device_command(struct command_context_s *cmd_ctx, char *
        lpc3180_info = malloc(sizeof(lpc3180_nand_controller_t));
        device->controller_priv = lpc3180_info;
 
-       lpc3180_info->target = get_target_by_num(strtoul(args[1], NULL, 0));
+       lpc3180_info->target = get_target(args[1]);
        if (!lpc3180_info->target)
        {
-               LOG_ERROR("no target '%s' configured", args[1]);
+               LOG_ERROR("target '%s' not defined", args[1]);
                return ERROR_NAND_DEVICE_INVALID;
        }