]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
part: check CONFIG_IS_ENABLED(ENV_SUPPORT)
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Fri, 21 Jul 2023 15:37:37 +0000 (17:37 +0200)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 30 Jul 2023 16:51:18 +0000 (18:51 +0200)
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>
disk/part.c

index 186ee965006e5d4bf21d14178445fcd42a2a5eaa..eec02f58988d71efd2110dc47c105a908e596243 100644 (file)
@@ -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) {