mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 3/6] cfi_flash_new: generate flash erase dots in common function
Date: Mon,  8 Feb 2010 14:47:29 +0100	[thread overview]
Message-ID: <1265636852-19054-4-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1265636852-19054-3-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/nor/cfi_flash_amd.c   |    9 +--------
 drivers/nor/cfi_flash_intel.c |    9 +--------
 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 b92836b..44eb881 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 142fb0e..c2d92e7 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 d85e0be..f9306cb 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');
-- 
1.6.6


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2010-02-08 13:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08 13:47 Clean up flash driver confusion Sascha Hauer
2010-02-08 13:47 ` [PATCH 1/6] cfi_flash_new: Fix Intel chips Sascha Hauer
2010-02-08 13:47   ` [PATCH 2/6] cfi_flash_new: Safe indention level by bailing out earlier in error case Sascha Hauer
2010-02-08 13:47     ` Sascha Hauer [this message]
2010-02-08 13:47       ` [PATCH 4/6] cfi_flash_new: make code more readable, return is not a function Sascha Hauer
2010-02-08 13:47         ` [PATCH 5/6] cfi_flash: remove old driver and switch to new one Sascha Hauer
2010-02-08 13:47           ` [PATCH 6/6] cfi_flash: move include/cfi_flash.c next to driver Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1265636852-19054-4-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox