]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
hwconfig: Allow to compile it without env support
authorPali Rohár <pali@kernel.org>
Sat, 2 Apr 2022 22:24:25 +0000 (00:24 +0200)
committerPriyanka Jain <priyanka.jain@nxp.com>
Tue, 26 Apr 2022 11:48:39 +0000 (17:18 +0530)
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>
common/hwconfig.c

index 63b3ccaf84e29c786028a800328ec04ee02e5793..43566b81bd48f11a893ddc5b83b9dabdff1addcf 100644 (file)
@@ -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) {