public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] hwconfig: Allow to use restricted env
@ 2022-08-07 19:06 Pali Rohár
  2022-08-20 23:02 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2022-08-07 19:06 UTC (permalink / raw)
  To: Simon Glass, Wolfgang Denk; +Cc: u-boot

During early boot phase GD_FLG_ENV_READY is not set but env_get() may work
when env is ready in restricted mode. Do not fail with error message
"WARNING: Calling __hwconfig without a buffer and before environment is ready"
when env is already working by checking for ENV_VALID flag.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 common/hwconfig.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/hwconfig.c b/common/hwconfig.c
index 43566b81bd48..cac0b6348f46 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -78,7 +78,7 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
 
 	/* if we are passed a buffer use it, otherwise try the environment */
 	if (!env_hwconfig) {
-		if (!(gd->flags & GD_FLG_ENV_READY)) {
+		if (!(gd->flags & GD_FLG_ENV_READY) && gd->env_valid != ENV_VALID) {
 			printf("WARNING: Calling __hwconfig without a buffer "
 					"and before environment is ready\n");
 			return NULL;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-20 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-07 19:06 [PATCH] hwconfig: Allow to use restricted env Pali Rohár
2022-08-20 23:02 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox