[PATCH] test: bootdev: Do not require USB to compile test

Linus Walleij linus.walleij at linaro.org
Mon Jan 23 23:07:21 CET 2023


This test will block compilation of the entire test suite
on platforms without USB support. Make the extern
"usb_started" conditional on USB host or gadget and
define a dummy flag if neither is enabled.

Cc: Simon Glass <sjg at chromium.org>
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 test/boot/bootdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/test/boot/bootdev.c b/test/boot/bootdev.c
index 1c2a79fb1084..fa466b708184 100644
--- a/test/boot/bootdev.c
+++ b/test/boot/bootdev.c
@@ -18,7 +18,11 @@
 #include "bootstd_common.h"
 
 /* Allow reseting the USB-started flag */
+#if defined(CONFIG_USB_HOST) || defined(CONFIG_USB_GADGET)
 extern char usb_started;
+#else
+char usb_started;
+#endif
 
 /* Check 'bootdev list' command */
 static int bootdev_test_cmd_list(struct unit_test_state *uts)
-- 
2.39.0



More information about the U-Boot mailing list