From: Dan Carpenter <dan.carpenter@linaro.org>
Date: Wed, 21 Feb 2024 06:26:09 +0000 (+0300)
Subject: bootflow: Fix build error when BOOTMETH_CROS is disabled
X-Git-Tag: v2025.01-rc5-pxa1908~578^2~20^2~5
X-Git-Url: http://git.dujemihanovic.xyz/img/html/static/login.html?a=commitdiff_plain;h=2160cb141fe9dc22d3efa5ea6aed90f30fa0ff84;p=u-boot.git

bootflow: Fix build error when BOOTMETH_CROS is disabled

The bootflow testing assumes that BOOTMETH_CROS is enabled but it
might not be which leads to a build error.

aarch64-linux-gnu-ld.bfd: test/boot/bootflow.o: in function `prep_mmc_bootdev':
test/boot/bootflow.c:549:(.text.prep_mmc_bootdev+0x1c8):
    undefined reference to `_u_boot_list_2_driver_2_bootmeth_cros'

Fixes: d08db02d2d3d ("bootstd: Add a test for bootmeth_cros")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---

diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index fa54dde661..4845b7121c 100644
--- a/test/boot/bootflow.c
+++ b/test/boot/bootflow.c
@@ -544,7 +544,7 @@ static int prep_mmc_bootdev(struct unit_test_state *uts, const char *mmc_dev,
 				"bootmeth_script", 0, ofnode_null(), &dev));
 
 	/* Enable the cros bootmeth if needed */
-	if (bind_cros) {
+	if (IS_ENABLED(CONFIG_BOOTMETH_CROS) && bind_cros) {
 		ut_assertok(uclass_first_device_err(UCLASS_BOOTSTD, &bootstd));
 		ut_assertok(device_bind(bootstd, DM_DRIVER_REF(bootmeth_cros),
 					"cros", 0, ofnode_null(), &dev));