From patchwork Tue Jan 16 09:16:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 124635 Delivered-To: patch@linaro.org Received: by 10.46.64.148 with SMTP id r20csp947735lje; Tue, 16 Jan 2018 01:20:54 -0800 (PST) X-Google-Smtp-Source: ACJfBouuzx7wtv8UwOeTZ+7Sy/jpZPPFZTwi7xScNahsFt8yj92u2LwzQ4hXclK3cYhAt3f83ejt X-Received: by 10.80.133.140 with SMTP id a12mr6072882edh.286.1516094454518; Tue, 16 Jan 2018 01:20:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516094454; cv=none; d=google.com; s=arc-20160816; b=ymEs+ydLXSc0YKbvYxIfBaCWf0/BiqI6UX3cp5DRfcWCt6BHQJLuW1U9/hpGwI7rkU BM5mCbBTXlYKml7ZvtuEzgRrUz9F2Q3lMA6SXLg/dTOmPPPuCAGGr+pYqk2Cm3NN9Qen staNcO/zP6ygZnFj6cHeQYikJsPo/IPle+IyCdpy3YeWD444ElLI89Oc/1b25Aat5kmC AbsOowsxTHdsfWmHg8+NJJAXuDtzmFbDbnAgsbR58o7Yil9KlQRKGfJQBajbcFRpEvnE pivBFfTAoqQze3uEa3FU5/WrGJHVHkTzko41BbLFtM+RwixD7Dszzk79bD9NNdiTvxCh yS9w== 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=/9OWVL1VT96Ro5/u8yADQVCfbrU8Ro5F38Lzt16imQk=; b=ulCmhAj6R9BV+fiWfZc0QKLuuPj67qYNU+j+RwZ9g+p2c7tb8wN2sANpQaFpX17LdD PhYl5eFkcW194kIqJlOd9RaFAgQpz6kWlIvmwSl5Eo5jkAkX2QZJ1RfXAHpjr1fs/9Gx Mi6nwqWAm00gTxgZMQnEbILzQwWWEKen9hYEoUnpdJ6PUYEjXfV2WKEnpYxrnT9FCIa4 CC3DnxoDLVKtz8B5XdEmso0SWkkKY2qnPjL4Tm4DggkkB0opmu057fTjlf/56FXzk+r/ T6zeyMFWAmBOY3J5aDrA9F51RV1BW+59JXPaT/qpKaKAOl1xkk14mvgiMysheQH+WOmQ ljhQ== 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 n5si205872edc.132.2018.01.16.01.20.54; Tue, 16 Jan 2018 01:20:54 -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 E6902C21E10; Tue, 16 Jan 2018 09:18:53 +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 1EB93C21E5B; Tue, 16 Jan 2018 09:17:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 43AA1C21E2C; Tue, 16 Jan 2018 09:17:00 +0000 (UTC) Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by lists.denx.de (Postfix) with ESMTP id AF56DC21E08 for ; Tue, 16 Jan 2018 09:16:56 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 88CA4208BC; Tue, 16 Jan 2018 10:16:55 +0100 (CET) Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id 5A52420725; Tue, 16 Jan 2018 10:16:55 +0100 (CET) From: Maxime Ripard To: Tom Rini Date: Tue, 16 Jan 2018 10:16:41 +0100 Message-Id: <4f9f507c65d182e9e05cdfd46add9fd42a678a30.1516094113.git-series.maxime.ripard@free-electrons.com> 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 v2 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 afffab4c002a..9dd4d4cb4d11 100644 --- a/env/env.c +++ b/env/env.c @@ -122,12 +122,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; @@ -146,12 +149,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;