From mboxrd@z Thu Jan 1 00:00:00 1970 From: York Sun Date: Wed, 7 Feb 2018 14:17:12 -0800 Subject: [U-Boot] [PATCH 2/2] env: Add back default action of get_char in env_get_char() In-Reply-To: <1518041832-337-1-git-send-email-york.sun@nxp.com> References: <1518041832-337-1-git-send-email-york.sun@nxp.com> Message-ID: <1518041832-337-2-git-send-email-york.sun@nxp.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Commit 8a3a7e2270b3 ("env: Pass additional parameters to the env lookup function") dropped the default action if driver doesn't have get_char() defined. This causes failure to get environmental variables from NOR flash. Add back this default action for now. Signed-off-by: York Sun CC: Maxime Ripard --- Limited test on LS1043ARDB. env/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/env/env.c b/env/env.c index edfb575..210bae2 100644 --- a/env/env.c +++ b/env/env.c @@ -159,7 +159,7 @@ int env_get_char(int index) int ret; if (!drv->get_char) - continue; + return *(uchar *)(gd->env_addr + index); if (!env_has_inited(drv->location)) continue; -- 2.7.4