From: Pali Rohár <pali@kernel.org>
Date: Sat, 2 Apr 2022 22:24:25 +0000 (+0200)
Subject: hwconfig: Allow to compile it without env support
X-Git-Tag: v2025.01-rc5-pxa1908~1429^2~38
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/%7B%7B%20%24style.RelPermalink%20%7D%7D?a=commitdiff_plain;h=d64a8fd0a9021ef0a87e6f3e315c8d65a8dd7bd0;p=u-boot.git

hwconfig: Allow to compile it without env support

When env support is disabled then usage of env_get() generates linker
errors. So do not compile env_get() when env support is disabled (for
example when disabled only in SPL).

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
---

diff --git a/common/hwconfig.c b/common/hwconfig.c
index 63b3ccaf84..43566b81bd 100644
--- a/common/hwconfig.c
+++ b/common/hwconfig.c
@@ -83,7 +83,9 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
 					"and before environment is ready\n");
 			return NULL;
 		}
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
 		env_hwconfig = env_get("hwconfig");
+#endif
 	}
 
 	if (env_hwconfig) {