summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-07-21 17:37:37 +0200
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-07-30 18:51:18 +0200
commit350635fe837341e7ce7b7b900f18d7d306fdb42e (patch)
tree657628f59eab690a441c9bf863f5056fddbdafbc /disk
parent8acfd7ddce409cab5ac3b994faa0ae2c0d38ccf3 (diff)
downloadu-boot-350635fe837341e7ce7b7b900f18d7d306fdb42e.tar.gz
u-boot-350635fe837341e7ce7b7b900f18d7d306fdb42e.tar.bz2
u-boot-350635fe837341e7ce7b7b900f18d7d306fdb42e.zip
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>
Diffstat (limited to 'disk')
-rw-r--r--disk/part.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/disk/part.c b/disk/part.c
index 186ee96500..eec02f5898 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -508,9 +508,11 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
#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) {