diff options
Diffstat (limited to 'src/flash')
-rw-r--r-- | src/flash/ecos.c | 4 | ||||
-rw-r--r-- | src/flash/flash.c | 4 | ||||
-rw-r--r-- | src/flash/lpc3180_nand_controller.c | 4 | ||||
-rw-r--r-- | src/flash/mflash.c | 4 | ||||
-rw-r--r-- | src/flash/orion_nand.c | 4 | ||||
-rw-r--r-- | src/flash/s3c24xx_nand.c | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/src/flash/ecos.c b/src/flash/ecos.c index 3c2b456b..e1fa2d66 100644 --- a/src/flash/ecos.c +++ b/src/flash/ecos.c @@ -164,10 +164,10 @@ static int ecosflash_flash_bank_command(struct command_context_s *cmd_ctx, char bank->sectors[i].is_protected = 0; } - info->target = get_target_by_num(strtoul(args[5], NULL, 0)); + info->target = get_target(args[5]); if (info->target == NULL) { - LOG_ERROR("no target '%i' configured", (int)strtoul(args[5], NULL, 0)); + LOG_ERROR("target '%s' not defined", args[5]); return ERROR_FAIL; } return ERROR_OK; diff --git a/src/flash/flash.c b/src/flash/flash.c index 4f4d272a..ff66a396 100644 --- a/src/flash/flash.c +++ b/src/flash/flash.c @@ -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; } diff --git a/src/flash/lpc3180_nand_controller.c b/src/flash/lpc3180_nand_controller.c index 50846b92..1cbd9204 100644 --- a/src/flash/lpc3180_nand_controller.c +++ b/src/flash/lpc3180_nand_controller.c @@ -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; } diff --git a/src/flash/mflash.c b/src/flash/mflash.c index 8913e166..5df5261d 100644 --- a/src/flash/mflash.c +++ b/src/flash/mflash.c @@ -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; } diff --git a/src/flash/orion_nand.c b/src/flash/orion_nand.c index fb5a3403..f6f41f35 100644 --- a/src/flash/orion_nand.c +++ b/src/flash/orion_nand.c @@ -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; } diff --git a/src/flash/s3c24xx_nand.c b/src/flash/s3c24xx_nand.c index 291b658c..a26ac2d9 100644 --- a/src/flash/s3c24xx_nand.c +++ b/src/flash/s3c24xx_nand.c @@ -46,12 +46,12 @@ s3c24xx_nand_device_command(struct command_context_s *cmd_ctx, char *cmd, device->controller_priv = s3c24xx_info; - s3c24xx_info->target = get_target_by_num(strtoul(args[1], NULL, 0)); + s3c24xx_info->target = get_target(args[1]); if (s3c24xx_info->target == NULL) { - LOG_ERROR("no target '%s' configured", args[1]); + LOG_ERROR("target '%s' not defined", args[1]); return NULL; } - + return s3c24xx_info; } |