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>
This commit is contained in:
Heinrich Schuchardt
2023-07-21 17:37:37 +02:00
parent 8acfd7ddce
commit 350635fe83

View File

@@ -508,9 +508,11 @@ int blk_get_device_part_str(const char *ifname, const char *dev_part_str,
#endif #endif
/* If no dev_part_str, use bootdevice environment variable */ /* If no dev_part_str, use bootdevice environment variable */
if (!dev_part_str || !strlen(dev_part_str) || if (CONFIG_IS_ENABLED(ENV_SUPPORT)) {
!strcmp(dev_part_str, "-")) if (!dev_part_str || !strlen(dev_part_str) ||
dev_part_str = env_get("bootdevice"); !strcmp(dev_part_str, "-"))
dev_part_str = env_get("bootdevice");
}
/* If still no dev_part_str, it's an error */ /* If still no dev_part_str, it's an error */
if (!dev_part_str) { if (!dev_part_str) {