From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from [217.70.178.89] (helo=slow3-v.mail.gandi.net) by bombadil.infradead.org with esmtp (Exim 4.69 #1 (Red Hat Linux)) id 1NRtOq-0002nI-5Q for barebox@lists.infradead.org; Mon, 04 Jan 2010 20:19:40 +0000 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by slow3-v.mail.gandi.net (Postfix) with ESMTP id 6842F50D3C for ; Mon, 4 Jan 2010 20:47:43 +0100 (CET) Received: from d4rwin.no-ip.org (25.Red-79-153-8.dynamicIP.rima-tde.net [79.153.8.25]) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 177CE2552F9 for ; Mon, 4 Jan 2010 20:47:13 +0100 (CET) Date: Mon, 4 Jan 2010 20:42:57 +0100 From: Matthias Kaehlcke Message-ID: <20100104194257.GC19855@darwin> MIME-Version: 1.0 Content-Disposition: inline List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/2] New CFI flash driver: Fix misleading trace when unprotecting a sector To: barebox@lists.infradead.org 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 --- 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