part: check CONFIG_IS_ENABLED(ENV_SUPPORT)
In SPL environment variables may not be enabled.
Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
diff --git a/disk/part.c b/disk/part.c
index 186ee96..eec02f5 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -508,9 +508,11 @@
#endif
/* If no dev_part_str, use bootdevice environment variable */
- if (!dev_part_str || !strlen(dev_part_str) ||
- !strcmp(dev_part_str, "-"))
- dev_part_str = env_get("bootdevice");
+ if (CONFIG_IS_ENABLED(ENV_SUPPORT)) {
+ if (!dev_part_str || !strlen(dev_part_str) ||
+ !strcmp(dev_part_str, "-"))
+ dev_part_str = env_get("bootdevice");
+ }
/* If still no dev_part_str, it's an error */
if (!dev_part_str) {