Message ID | 20200212184501.5911-4-patrick.delaunay@st.com |
---|---|
State | Superseded |
Delegated to: | Tom Rini |
Headers | show
Return-Path: <u-boot-bounces@lists.denx.de> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=<UNKNOWN>) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.a=rsa-sha256 header.s=STMicroelectronics header.b=dQZ0rOwf; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 48HpXT738xz9s1x for <incoming@patchwork.ozlabs.org>; Thu, 13 Feb 2020 05:47:05 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6EAA081289; Wed, 12 Feb 2020 19:45:38 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="dQZ0rOwf"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id DBF7081244; Wed, 12 Feb 2020 19:45:23 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 26A4E81242 for <u-boot@lists.denx.de>; Wed, 12 Feb 2020 19:45:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=st.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=patrick.delaunay@st.com Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01CIgmr6006915; Wed, 12 Feb 2020 19:45:13 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=cim5RCor7m9WLRk7j2NFtE/aFBSp+BFFNE7/+z/yRa0=; b=dQZ0rOwfFKUiBWTe0GV12q/IWnjAlWEoRSGHFDpoVRPwIElDnXDWfcbNazDeA5tERTJe KyjjNbLnGB/h3Rbr0Ta9Ka6GCeKeh6a452g9yTNX3dV6eu08GNEVAzk2HEgWgNiLG/Sz A0OgeioPm9K6cIEC6SlD0ws53q0wquuXV+De7j+6K5qlRAtrLEReZQexUsQ+kdpaPaCW PymAP4gPdvu2s1b4EETW2DhzSgjU2kIJm1q02G/fpyRFt493ujwLnb9YPdgfFcEnH32L YInWFtvZ6alY2+Uj5s2DgRB6skHIgCMc2ywBtFwT2n6D7Yd+7Sa2RCd2+vykEUQbDuQu Yg== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2y1urhg7ps-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Feb 2020 19:45:13 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 458C0100040; Wed, 12 Feb 2020 19:45:06 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 3D3962C60B1; Wed, 12 Feb 2020 19:45:06 +0100 (CET) Received: from localhost (10.75.127.46) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 12 Feb 2020 19:45:05 +0100 From: Patrick Delaunay <patrick.delaunay@st.com> To: <u-boot@lists.denx.de> CC: Patrick Delaunay <patrick.delaunay@st.com>, Joe Hershberger <joe.hershberger@ni.com>, Wolfgang Denk <wd@denx.de>, U-Boot STM32 <uboot-stm32@st-md-mailman.stormreply.com> Subject: [RESEND PATCH 03/10] env: correctly handle result in env_init Date: Wed, 12 Feb 2020 19:44:54 +0100 Message-ID: <20200212184501.5911-4-patrick.delaunay@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200212184501.5911-1-patrick.delaunay@st.com> References: <20200212184501.5911-1-patrick.delaunay@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-12_08:2020-02-12, 2020-02-12 signatures=0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion <u-boot.lists.denx.de> List-Unsubscribe: <https://lists.denx.de/options/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=unsubscribe> List-Archive: <https://lists.denx.de/pipermail/u-boot/> List-Post: <mailto:u-boot@lists.denx.de> List-Help: <mailto:u-boot-request@lists.denx.de?subject=help> List-Subscribe: <https://lists.denx.de/listinfo/u-boot>, <mailto:u-boot-request@lists.denx.de?subject=subscribe> Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" <u-boot-bounces@lists.denx.de> X-Virus-Scanned: clamav-milter 0.102.1 at phobos.denx.de X-Virus-Status: Clean |
Series |
env: ext4: add test for env in ext4
|
expand
|
diff --git a/env/env.c b/env/env.c index 9237bb9c74..e4df1715e4 100644 --- a/env/env.c +++ b/env/env.c @@ -292,7 +292,10 @@ int env_init(void) int prio; for (prio = 0; (drv = env_driver_lookup(ENVOP_INIT, prio)); prio++) { - if (!drv->init || !(ret = drv->init())) + ret = 0; + if (drv->init) + ret = drv->init(); + if (!ret) env_set_inited(drv->location); debug("%s: Environment %s init done (ret=%d)\n", __func__,
Don't return error with ret=-ENOENT when the optional ops drv->init is absent but only if env_driver_lookup don't found driver. This patch correct an issue for the code if (!env_init()) env_load() When only ext4 is supported (CONFIG_ENV_IS_IN_EXT4), as the backend env/ext4.c doesn't define an ops .init Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> --- env/env.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)