diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2010-02-08 12:47:51 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-02-08 14:37:49 +0100 |
commit | 089066237d84e1451d2810a37a8084981665d8b8 (patch) | |
tree | 5d5a37ed7c005561c33584af24a563a564c3b1cc | |
parent | 146ba46d41816e6b8975b5dab5398d0690f171f9 (diff) | |
download | barebox-089066237d84e1451d2810a37a8084981665d8b8.tar.gz barebox-089066237d84e1451d2810a37a8084981665d8b8.tar.xz |
cfi_flash_new: generate flash erase dots in common function
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/nor/cfi_flash_amd.c | 9 | ||||
-rw-r--r-- | drivers/nor/cfi_flash_intel.c | 9 | ||||
-rw-r--r-- | drivers/nor/cfi_flash_new.c | 1 |
3 files changed, 3 insertions, 16 deletions
diff --git a/drivers/nor/cfi_flash_amd.c b/drivers/nor/cfi_flash_amd.c index b92836b0..44eb8814 100644 --- a/drivers/nor/cfi_flash_amd.c +++ b/drivers/nor/cfi_flash_amd.c @@ -73,20 +73,13 @@ static int amd_flash_is_busy (flash_info_t * info, flash_sect_t sect) static int amd_flash_erase_one (flash_info_t * info, long sect) { - int rcode = 0; - flash_unlock_seq (info, sect); flash_write_cmd (info, sect, AMD_ADDR_ERASE_START, AMD_CMD_ERASE_START); flash_unlock_seq (info, sect); flash_write_cmd (info, sect, 0, AMD_CMD_ERASE_SECTOR); - if (flash_status_check - (info, sect, info->erase_blk_tout, "erase")) { - rcode = 1; - } else - putchar('.'); - return rcode; + return flash_status_check(info, sect, info->erase_blk_tout, "erase"); } static void amd_flash_prepare_write(flash_info_t * info) diff --git a/drivers/nor/cfi_flash_intel.c b/drivers/nor/cfi_flash_intel.c index 142fb0e8..c2d92e71 100644 --- a/drivers/nor/cfi_flash_intel.c +++ b/drivers/nor/cfi_flash_intel.c @@ -34,18 +34,11 @@ static int intel_flash_is_busy (flash_info_t * info, flash_sect_t sect) static int intel_flash_erase_one (flash_info_t * info, long sect) { - int rcode = 0; - flash_write_cmd (info, sect, 0, FLASH_CMD_CLEAR_STATUS); flash_write_cmd (info, sect, 0, FLASH_CMD_BLOCK_ERASE); flash_write_cmd (info, sect, 0, FLASH_CMD_ERASE_CONFIRM); - if (flash_status_check - (info, sect, info->erase_blk_tout, "erase")) { - rcode = 1; - } else - putchar('.'); - return rcode; + return flash_status_check(info, sect, info->erase_blk_tout, "erase"); } static void intel_flash_prepare_write(flash_info_t * info) diff --git a/drivers/nor/cfi_flash_new.c b/drivers/nor/cfi_flash_new.c index d85e0bea..f9306cb4 100644 --- a/drivers/nor/cfi_flash_new.c +++ b/drivers/nor/cfi_flash_new.c @@ -521,6 +521,7 @@ static int cfi_erase(struct cdev *cdev, size_t count, unsigned long offset) ret = finfo->cfi_cmd_set->flash_erase_one(finfo, i); if (ret) goto out; + printf("."); } out: putchar('\n'); |