From: Pali Rohár Date: Sun, 7 Aug 2022 19:06:04 +0000 (+0200) Subject: hwconfig: Allow to use restricted env X-Git-Tag: v2022.10~44^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a871af2d5a59c26d4ff7e60530a7afce0742e6f0;p=platform%2Fkernel%2Fu-boot.git hwconfig: Allow to use restricted env 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 --- diff --git a/common/hwconfig.c b/common/hwconfig.c index 43566b8..cac0b63 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;