From patchwork Tue Nov 25 14:34:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guillaume GARDET X-Patchwork-Id: 414722 X-Patchwork-Delegate: trini@ti.com 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 A4EF11400F1 for ; Wed, 26 Nov 2014 01:34:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C4A7D4B62B; Tue, 25 Nov 2014 15:34:34 +0100 (CET) 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 hzMzN2-5yD2H; Tue, 25 Nov 2014 15:34:34 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5427B4B617; Tue, 25 Nov 2014 15:34:34 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B2EEA4B617 for ; Tue, 25 Nov 2014 15:34:29 +0100 (CET) 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 Juv8TCbqWcQt for ; Tue, 25 Nov 2014 15:34:29 +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 smtp6-g21.free.fr (smtp6-g21.free.fr [212.27.42.6]) by theia.denx.de (Postfix) with ESMTPS id 87BA24B615 for ; Tue, 25 Nov 2014 15:34:26 +0100 (CET) Received: from OLI01.site (unknown [82.244.147.214]) by smtp6-g21.free.fr (Postfix) with ESMTP id F2C3F8233E; Tue, 25 Nov 2014 15:33:55 +0100 (CET) From: Guillaume GARDET To: u-boot@lists.denx.de Date: Tue, 25 Nov 2014 15:34:16 +0100 Message-Id: <1416926056-23142-1-git-send-email-guillaume.gardet@free.fr> X-Mailer: git-send-email 1.8.4.5 Cc: Tom Rini Subject: [U-Boot] [PATCH] spl: Fix SPL EXT support X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Commit 9f12cd0e062614e19734b2ab37842d387457c5e5 has broken SPL EXT support. This patch update error code check to get SPL EXT support working again. Tested on a Pandaboard (rev. A3). Signed-off-by: Guillaume GARDET Cc: Tom Rini Cc: Suriyan Ramasami Reviewed-by: Simon Glass --- common/spl/spl_ext.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c index 5ff9bc5..9d37fd3 100644 --- a/common/spl/spl_ext.c +++ b/common/spl/spl_ext.c @@ -43,7 +43,7 @@ int spl_load_image_ext(block_dev_desc_t *block_dev, goto end; } err = ext4fs_read((char *)header, sizeof(struct image_header), &actlen); - if (err <= 0) { + if (err < 0) { puts("spl: ext4fs_read failed\n"); goto end; } @@ -54,12 +54,12 @@ int spl_load_image_ext(block_dev_desc_t *block_dev, end: #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT - if (err <= 0) + if (err < 0) printf("%s: error reading image %s, err - %d\n", __func__, filename, err); #endif - return err <= 0; + return err < 0; } #ifdef CONFIG_SPL_OS_BOOT @@ -95,7 +95,7 @@ int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition) goto defaults; } err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); - if (err <= 0) { + if (err < 0) { printf("spl: error reading image %s, err - %d, falling back to default\n", file, err); goto defaults; @@ -124,7 +124,7 @@ defaults: puts("spl: ext4fs_open failed\n"); err = ext4fs_read((void *)CONFIG_SYS_SPL_ARGS_ADDR, filelen, &actlen); - if (err <= 0) { + if (err < 0) { #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT printf("%s: error reading image %s, err - %d\n", __func__, CONFIG_SPL_FS_LOAD_ARGS_NAME, err);