From patchwork Fri Dec 3 23:25:43 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Sakoman X-Patchwork-Id: 74222 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 7647AB70A7 for ; Sat, 4 Dec 2010 10:26:00 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9F8C2813B; Sat, 4 Dec 2010 00:25:56 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KY4bXLp48LKq; Sat, 4 Dec 2010 00:25:56 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5CB452813D; Sat, 4 Dec 2010 00:25:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 3D1F22813D for ; Sat, 4 Dec 2010 00:25:53 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0K1J5A3fxrQR for ; Sat, 4 Dec 2010 00:25:51 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qy0-f179.google.com (mail-qy0-f179.google.com [209.85.216.179]) by theia.denx.de (Postfix) with ESMTPS id 09F302813B for ; Sat, 4 Dec 2010 00:25:48 +0100 (CET) Received: by qyk11 with SMTP id 11so10620300qyk.3 for ; Fri, 03 Dec 2010 15:25:47 -0800 (PST) Received: by 10.220.202.196 with SMTP id ff4mr572814vcb.6.1291418747345; Fri, 03 Dec 2010 15:25:47 -0800 (PST) Received: from [192.168.0.210] (static-74-41-60-154.dsl1.pco.ca.frontiernet.net [74.41.60.154]) by mx.google.com with ESMTPS id b28sm449621vcm.6.2010.12.03.15.25.45 (version=SSLv3 cipher=RC4-MD5); Fri, 03 Dec 2010 15:25:46 -0800 (PST) From: Steve Sakoman To: "u-boot@lists.denx.de" Date: Fri, 03 Dec 2010 15:25:43 -0800 Message-ID: <1291418743.23352.12.camel@quadra> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 Subject: [U-Boot] [PATCH] env_nand: Use nand_read_skip_bad instead of nand_read X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de The nand-read function returns an error code if correctable errors have occurred. This is not desirable, since the errors have been corrected! This patch switches to the nand_read_skip_bad function which does not return an error code if the errors are correctable. Signed-off-by: Steve Sakoman Acked-by: Scott Wood diff --git a/common/env_nand.c b/common/env_nand.c index 4e8307a..7f6c917 100644 --- a/common/env_nand.c +++ b/common/env_nand.c @@ -297,7 +297,7 @@ int readenv(size_t offset, u_char * buf) offset += blocksize; } else { char_ptr = &buf[amount_loaded]; - if (nand_read(&nand_info[0], offset, &len, char_ptr)) + if (nand_read_skip_bad(&nand_info[0], offset, &len, char_ptr)) return 1; offset += blocksize; amount_loaded += len;