From: Heinrich Schuchardt Date: Fri, 21 Jul 2023 15:37:37 +0000 (+0200) Subject: part: check CONFIG_IS_ENABLED(ENV_SUPPORT) X-Git-Tag: v2025.01-rc5-pxa1908~910^2~3 X-Git-Url: http://git.dujemihanovic.xyz/%22http:/www.sics.se/static/git-favicon.png?a=commitdiff_plain;h=350635fe837341e7ce7b7b900f18d7d306fdb42e;p=u-boot.git part: check CONFIG_IS_ENABLED(ENV_SUPPORT) In SPL environment variables may not be enabled. Suggested-by: Tom Rini Signed-off-by: Heinrich Schuchardt Reviewed-by: Tom Rini --- 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) {