From 093ec6656ab7fb523b8a811f4bd628e3b50f8367 Mon Sep 17 00:00:00 2001 From: Antonio Borneo Date: Fri, 31 Dec 2010 19:46:09 +0800 Subject: NAND/S3CXXXX: remove private "target" copy Remove "target" form private data, and use common one in struct nand_block. Signed-off-by: Antonio Borneo --- src/flash/nand/s3c24xx.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/flash/nand/s3c24xx.c') diff --git a/src/flash/nand/s3c24xx.c b/src/flash/nand/s3c24xx.c index e3b5c2e2..eb20f35c 100644 --- a/src/flash/nand/s3c24xx.c +++ b/src/flash/nand/s3c24xx.c @@ -43,13 +43,6 @@ S3C24XX_DEVICE_COMMAND() } nand->controller_priv = s3c24xx_info; - - s3c24xx_info->target = get_target(CMD_ARGV[1]); - if (s3c24xx_info->target == NULL) { - LOG_ERROR("target '%s' not defined", CMD_ARGV[1]); - return ERROR_COMMAND_SYNTAX_ERROR; - } - *info = s3c24xx_info; return ERROR_OK; @@ -58,7 +51,7 @@ S3C24XX_DEVICE_COMMAND() int s3c24xx_reset(struct nand_device *nand) { struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv; - struct target *target = s3c24xx_info->target; + struct target *target = nand->target; if (target->state != TARGET_HALTED) { LOG_ERROR("target must be halted to use S3C24XX NAND flash controller"); @@ -73,7 +66,7 @@ int s3c24xx_reset(struct nand_device *nand) int s3c24xx_command(struct nand_device *nand, uint8_t command) { struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv; - struct target *target = s3c24xx_info->target; + struct target *target = nand->target; if (target->state != TARGET_HALTED) { LOG_ERROR("target must be halted to use S3C24XX NAND flash controller"); @@ -88,7 +81,7 @@ int s3c24xx_command(struct nand_device *nand, uint8_t command) int s3c24xx_address(struct nand_device *nand, uint8_t address) { struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv; - struct target *target = s3c24xx_info->target; + struct target *target = nand->target; if (target->state != TARGET_HALTED) { LOG_ERROR("target must be halted to use S3C24XX NAND flash controller"); @@ -102,7 +95,7 @@ int s3c24xx_address(struct nand_device *nand, uint8_t address) int s3c24xx_write_data(struct nand_device *nand, uint16_t data) { struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv; - struct target *target = s3c24xx_info->target; + struct target *target = nand->target; if (target->state != TARGET_HALTED) { LOG_ERROR("target must be halted to use S3C24XX NAND flash controller"); @@ -116,7 +109,7 @@ int s3c24xx_write_data(struct nand_device *nand, uint16_t data) int s3c24xx_read_data(struct nand_device *nand, void *data) { struct s3c24xx_nand_controller *s3c24xx_info = nand->controller_priv; - struct target *target = s3c24xx_info->target; + struct target *target = nand->target; if (target->state != TARGET_HALTED) { LOG_ERROR("target must be halted to use S3C24XX NAND flash controller"); -- cgit v1.2.3