"script@1" is not a valid node name if the "reg" property is missing.
The yocto build system embeds the boot script as an image that's pointed
to by the "bootscr" property within the default configuration. That is
what we use here as the fallback when sourcing the "script@1" fails.
This implementation should be backward-compatible with existing ITS
files.

Signed-off-by: Sven Schwermer <s...@svenschwermer.de>
---
 drivers/usb/gadget/f_sdp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/f_sdp.c b/drivers/usb/gadget/f_sdp.c
index e48aa2f90d..2eb85aa8a6 100644
--- a/drivers/usb/gadget/f_sdp.c
+++ b/drivers/usb/gadget/f_sdp.c
@@ -866,7 +866,11 @@ static int sdp_handle_in_ep(struct spl_image_info 
*spl_image)
                        jump_to_image_no_args(&spl_image);
 #else
                        /* In U-Boot, allow jumps to scripts */
-                       image_source_script(sdp_func->jmp_address, "script@1");
+#if defined(CONFIG_FIT)
+                       if (image_source_script(sdp_func->jmp_address, 
"script@1"))
+                               /* Retry with default configuration script */
+#endif
+                               image_source_script(sdp_func->jmp_address, 
NULL);
 #endif
                }
 
-- 
2.34.1

Reply via email to