mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Matthias Kaehlcke <matthias@kaehlcke.net>
To: barebox@lists.infradead.org
Subject: [PATCH 2/2] New CFI flash driver: Fix misleading trace when unprotecting a sector
Date: Mon, 4 Jan 2010 20:42:57 +0100	[thread overview]
Message-ID: <20100104194257.GC19855@darwin> (raw)

When (un)protecting a flash sector with the new CFI flash driver a trace
"protect 0x..." is generated, independently of the type of operation. This is
misleading in case of an unprotect. Tell the truth when unprotecting a sector.

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
---
 drivers/nor/cfi_flash_new.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/nor/cfi_flash_new.c b/drivers/nor/cfi_flash_new.c
index c9910ed..d85e0be 100644
--- a/drivers/nor/cfi_flash_new.c
+++ b/drivers/nor/cfi_flash_new.c
@@ -664,8 +664,10 @@ static int cfi_protect(struct cdev *cdev, size_t count, unsigned long offset, in
 	flash_info_t *finfo = (flash_info_t *)cdev->priv;
 	unsigned long start, end;
 	int i, ret = 0;
+	const char *action = (prot? "protect" : "unprotect");
 
-	printf("%s: protect 0x%08x (size %d)\n", __FUNCTION__, cdev->dev->map_base + offset, count);
+	printf("%s: %s 0x%08x (size %d)\n", __FUNCTION__,
+		action, cdev->dev->map_base + offset, count);
 
 	start = find_sector(finfo, cdev->dev->map_base + offset);
 	end   = find_sector(finfo, cdev->dev->map_base + offset + count - 1);
-- 
1.6.3.1


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

                 reply	other threads:[~2010-01-04 20:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100104194257.GC19855@darwin \
    --to=matthias@kaehlcke.net \
    --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