summaryrefslogtreecommitdiffstats
path: root/drivers/nor
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias@kaehlcke.net>2010-01-04 20:42:52 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2010-01-05 13:14:37 +0100
commitcd1e08850f1712d0e43004ef92743df34d6f94ae (patch)
treef46c7fe6b940344183460b39d5bb2af90358ea88 /drivers/nor
parenta854d2bdc3233f9ba6cdbb0399ae2310ecd97bf9 (diff)
downloadbarebox-cd1e08850f1712d0e43004ef92743df34d6f94ae.tar.gz
barebox-cd1e08850f1712d0e43004ef92743df34d6f94ae.tar.xz
CFI flash driver: Fix misleading trace when unprotecting a sector
When (un)protecting a flash sector with the 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> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/nor')
-rw-r--r--drivers/nor/cfi_flash.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nor/cfi_flash.c b/drivers/nor/cfi_flash.c
index 37206d0e52..938e2cb7bb 100644
--- a/drivers/nor/cfi_flash.c
+++ b/drivers/nor/cfi_flash.c
@@ -380,7 +380,8 @@ static int cfi_protect(struct cdev *cdev, size_t count, unsigned long offset, in
unsigned long start, end;
int i, ret = 0;
- debug("%s: protect 0x%08x (size %d)\n", __FUNCTION__, offset, count);
+ debug("%s: %sprotect 0x%08x (size %d)\n",
+ __FUNCTION__, (prot? "" : "un"), offset, count);
start = flash_find_sector(finfo, cdev->dev->map_base + offset);
end = flash_find_sector(finfo, cdev->dev->map_base + offset + count - 1);