Consolidate target selection code into single get_target() that handles both names...
[fw/openocd] / src / flash / orion_nand.c
index fb5a34037d22f0647305472c76853baed588eaad..f6f41f35b8af62e67778c240aac604bd2c4cbeb7 100644 (file)
@@ -210,9 +210,9 @@ int orion_nand_device_command(struct command_context_s *cmd_ctx, char *cmd,
        }
 
        device->controller_priv = hw;
-       hw->target = get_target_by_num(strtoul(args[1], NULL, 0));
+       hw->target = get_target(args[1]);
        if (!hw->target) {
-               LOG_ERROR("no target '%s' configured", args[1]);
+               LOG_ERROR("target '%s' not defined", args[1]);
                free(hw);
                return ERROR_NAND_DEVICE_INVALID;
        }