From patchwork Wed Sep 17 03:51:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 390269 X-Patchwork-Delegate: sjg@chromium.org 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 9694C140119 for ; Wed, 17 Sep 2014 13:52:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E4854A7482; Wed, 17 Sep 2014 05:52:35 +0200 (CEST) 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 8ges+WuNz5Ac; Wed, 17 Sep 2014 05:52:35 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EF022A7484; Wed, 17 Sep 2014 05:52:11 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65985A7477 for ; Wed, 17 Sep 2014 05:52:07 +0200 (CEST) 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 ReRkvTRCOPWT for ; Wed, 17 Sep 2014 05:52:05 +0200 (CEST) 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-pd0-f202.google.com (mail-pd0-f202.google.com [209.85.192.202]) by theia.denx.de (Postfix) with ESMTPS id 63686A73E9 for ; Wed, 17 Sep 2014 05:51:59 +0200 (CEST) Received: by mail-pd0-f202.google.com with SMTP id ft15so295738pdb.5 for ; Tue, 16 Sep 2014 20:51:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=4MJlxAFumxi18M5AQfz475zVlq1OwH92DqnF6sTh7XQ=; b=Z5Z+CcSPJumhRc7Vsja8Yk8cDknyc6wrHrBZPs+ue6XCNr4boY+IHwq7m8gK92zoK8 JqKWFFu4zQahBf3BjgkIXD/QqNnwjVWFYpPLWzac/svgpeuJVeMpWu4eadRgeDLr5N1y rnT1Gcohv/xTyEZsQP7DMDewjGMfSdFZ9BIfq6PbaaB7UMedeWxZ9uc7Or0D/lFkpaGM K09TDxze1XpcHlo/6qUsjmo7dXS6dxQNDgtAN9vRNe6UCwoOyZH2SYN+q62qrn1BtxvT b8Shft4Wis37GgJ4/S+G25ohziBMVrD4oLzoN1kbjag8GozdRXgylxNQ9Wh1OEgCUgUL /njg== X-Gm-Message-State: ALoCoQlnNqYK27bZecNQMgLOASi8vF20i3MOuIl9pUpsQ2eyzTVh32gJbpaaAi0mw/wOpXuFJFgr X-Received: by 10.68.99.225 with SMTP id et1mr22607000pbb.0.1410925917734; Tue, 16 Sep 2014 20:51:57 -0700 (PDT) Received: from corpmail-nozzle1-2.hot.corp.google.com ([100.108.1.103]) by gmr-mx.google.com with ESMTPS id j25si795232yhb.0.2014.09.16.20.51.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Sep 2014 20:51:57 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-2.hot.corp.google.com with ESMTP id M3W598dh.1; Tue, 16 Sep 2014 20:51:57 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 7EAC62217E4; Tue, 16 Sep 2014 21:51:56 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Tue, 16 Sep 2014 21:51:17 -0600 Message-Id: <1410925884-8767-5-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.1.0.rc2.206.gedb03e5 In-Reply-To: <1410925884-8767-1-git-send-email-sjg@chromium.org> References: <1410925884-8767-1-git-send-email-sjg@chromium.org> Subject: [U-Boot] [PATCH v2 04/11] initcall: Display error number when an error occurs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Now that some initcall functions return a useful error number, display it when something goes wrong. Signed-off-by: Simon Glass Acked-by: Igor Grinberg --- Changes in v2: - Add patch to display error number when an error occurs in initcall lib/initcall.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/initcall.c b/lib/initcall.c index 7597bad..39f4b3f 100644 --- a/lib/initcall.c +++ b/lib/initcall.c @@ -15,14 +15,16 @@ int initcall_run_list(const init_fnc_t init_sequence[]) for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) { unsigned long reloc_ofs = 0; + int ret; if (gd->flags & GD_FLG_RELOC) reloc_ofs = gd->reloc_off; debug("initcall: %p\n", (char *)*init_fnc_ptr - reloc_ofs); - if ((*init_fnc_ptr)()) { - printf("initcall sequence %p failed at call %p\n", + ret = (*init_fnc_ptr)(); + if (ret) { + printf("initcall sequence %p failed at call %p (err=%d)\n", init_sequence, - (char *)*init_fnc_ptr - reloc_ofs); + (char *)*init_fnc_ptr - reloc_ofs, ret); return -1; } }