Skip to contentSkip to conversation

CFI flash driver: Fix misleading trace when unprotecting a sector

PATCH In review Matthias Kaehlcke 1 participant 1 message Jan 4, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 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.

---
 drivers/nor/cfi_flash.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/nor/cfi_flash.c +2 -1
index 37206d0..938e2cb 100644
@@ -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);
Signature · 7 lines
1.6.3.1


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox