[PATCH] fixup! fastboot/dfu: use system partitions as fall back

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Apr 30 18:57:02 BST 2021


For configuration where DFU is disabled, opts->dfu_opts.files would
contain the system partitions and multi-gadget auto start would
fail. Ignore dfu == true when support is not compiled in.

Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
 common/usbgadget.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/usbgadget.c b/common/usbgadget.c
index bdbb4d794889..489b3b801630 100644
--- a/common/usbgadget.c
+++ b/common/usbgadget.c
@@ -53,7 +53,7 @@ int usbgadget_register(bool dfu, const char *dfu_opts,
 	opts = xzalloc(sizeof(*opts));
 	opts->release = usb_multi_opts_release;
 
-	if (dfu)
+	if (IS_ENABLED(CONFIG_USB_GADGET_DFU) && dfu)
 		opts->dfu_opts.files = dfu_opts ? parse(dfu_opts)
 			: get_dfu_function();
 
-- 
2.29.2




More information about the barebox mailing list