Skip to contentSkip to conversation

New 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 2/2 New CFI flash driver: Fix misleading trace when unprotecting a sector

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.

---
 drivers/nor/cfi_flash_new.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
drivers/nor/cfi_flash_new.c +3 -1
index c9910ed..d85e0be 100644
@@ -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);
Signature · 7 lines
1.6.3.1


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