From patchwork Tue Jan 23 20:16:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 125581 Delivered-To: patch@linaro.org Received: by 10.46.66.141 with SMTP id h13csp1984841ljf; Tue, 23 Jan 2018 12:25:16 -0800 (PST) X-Google-Smtp-Source: AH8x224ZwPgwxRCohPpLX6Etn7uFyLcZI/kIu9dAZTtPbGEAtsWjJ9b0j7S2/yAHnLErsG7rbsAt X-Received: by 10.80.207.206 with SMTP id i14mr20696164edk.133.1516739115958; Tue, 23 Jan 2018 12:25:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516739115; cv=none; d=google.com; s=arc-20160816; b=jYsvTHT+6UUJY+q6ls2H9Xi3nzNNhp4YUNKhQ75Fy/CaAfUoK4Z3jhjq1lQRP2Rr3S +d21ACBJfzzPN06dNI5yVEeTpDfAkDZnM6ZWKbKu9rK/HqYdb4PcTZRaPPUPoJgKNkQ1 QMjxTSxBFYhWCPTs+L8RLqkQSCCQf73Ttg5y7fxiWjeFIlgo/7eAtWK5JuEbG42yDYkT QqU7SMh7yfpSRoS/h190KNrmWaSl0wbXld8ZoMZJDdDZyjyamUVl5X84LDgIUL6zp0R/ OWSP6nasIR00aYT+i9JYiw6Cy2sXUXjWslo1dWooj7xdKhdOnP8gSlPbdMwwtllgQ4Vi +mIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:arc-authentication-results; bh=+smlgpxBVVwNR1TBgYVnZyvWQ0ZV5bDSZUeqOPCNvls=; b=Z+ewj3MjqrUNVvY2GfyBs6wsFg7b5U+VHn7E8Mr0YtZ4oyL37lm5B50bNB5kXsmxMr xFtOAAfe3Peka/0AVZnWTmZQK91mxMTGExICjioyHdkJtE7ZP/u7trQ7ybEXmw/UGQEE ZimrwOpDRiAcK6X7fw8NX2Y9ucs5MgQ0V9gPkClwG35lRmYrxtfnf6FPI5VAvxHsG3SP o7IVLm8INHzZqCr6U9sUaFtRH8DZrQ+Z3dxWvk9lh5JQ6JNdWCD4jlQoW2YdjJaaElk6 xS6YSpsDoNAgXyEamRmUAMHWU6BwXWZc7ap5tccH2i5UHQwBiNHlN9n2hC2aQhdDfTCu W+9g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Return-Path: Received: from lists.denx.de (dione.denx.de. [81.169.180.215]) by mx.google.com with ESMTP id f6si2408972eda.157.2018.01.23.12.25.15; Tue, 23 Jan 2018 12:25:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) client-ip=81.169.180.215; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of u-boot-bounces@lists.denx.de designates 81.169.180.215 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by lists.denx.de (Postfix, from userid 105) id 84829C22169; Tue, 23 Jan 2018 20:20:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id DB3A1C22168; Tue, 23 Jan 2018 20:17:31 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 5C4AAC21EBB; Tue, 23 Jan 2018 20:17:17 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id 494BEC21F0A for ; Tue, 23 Jan 2018 20:17:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 2710420D86; Tue, 23 Jan 2018 21:17:12 +0100 (CET) Received: from localhost (LFbn-1-2035-97.w90-76.abo.wanadoo.fr [90.76.104.97]) by mail.free-electrons.com (Postfix) with ESMTPSA id EA846207A8; Tue, 23 Jan 2018 21:17:11 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Tue, 23 Jan 2018 21:16:54 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 In-Reply-To: References: In-Reply-To: References: Cc: Andre Przywara , agraf@suse.de, u-boot@lists.denx.de, Maxime Ripard , Jagan Teki Subject: [U-Boot] [PATCH v3 05/15] env: Make it explicit where we're loading our environment from X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Since we can have multiple environments now, it's better to provide a decent indication on what environments were tried and which were the one to fail and succeed. Reviewed-by: Simon Glass Signed-off-by: Maxime Ripard --- env/env.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/env/env.c b/env/env.c index 11667a3cbc71..906f28ee50a1 100644 --- a/env/env.c +++ b/env/env.c @@ -144,12 +144,15 @@ int env_load(void) if (!drv->load) continue; + printf("Loading Environment from %s... ", drv->name); ret = drv->load(); + if (ret) + printf("Failed (%d)\n", ret); + else + printf("OK\n"); + if (!ret) return 0; - - debug("%s: Environment %s failed to load (err=%d)\n", __func__, - drv->name, ret); } return -ENODEV; @@ -168,12 +171,13 @@ int env_save(void) printf("Saving Environment to %s... ", drv->name); ret = drv->save(); - printf("%s\n", ret ? "Failed" : "OK"); + if (ret) + printf("Failed (%d)\n", ret); + else + printf("OK\n"); + if (!ret) return 0; - - debug("%s: Environment %s failed to save (err=%d)\n", __func__, - drv->name, ret); } return -ENODEV;