mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] fastboot: explain use of struct fastboot::cmd_exec/flash
@ 2024-04-02 10:00 Ahmad Fatoum
  2024-04-03 11:30 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2024-04-02 10:00 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

Commit ed1dded0898f ("usb: gadget: fastboot: Add external command
execution support") added hooks that allow board code to register its
own OEM extensions for Fastboot. There are no users of these hooks
upstream and without digging into the Git history, it's not evident, why
these hooks are there, especially as the files have been renamed since.

Add a comment to explain what these never-set callbacks are for.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 common/fastboot.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/fastboot.c b/common/fastboot.c
index d8dabd89ab27..f8a01dea7a65 100644
--- a/common/fastboot.c
+++ b/common/fastboot.c
@@ -666,6 +666,7 @@ static void cb_flash(struct fastboot *fb, const char *cmd)
 		goto out;
 	}
 
+	/* Check if board-code registered a vendor-specific handler */
 	if (fb->cmd_flash) {
 		ret = fb->cmd_flash(fb, fentry, fb->tempname, fb->download_size);
 		if (ret != FASTBOOT_CMD_FALLTHROUGH)
@@ -940,6 +941,7 @@ void fastboot_exec_cmd(struct fastboot *fb, const char *cmdbuf)
 	g_fb = fb;
 	fb->active = true;
 
+	/* Check if board-code registered a vendor-specific handler */
 	if (fb->cmd_exec) {
 		ret = fb->cmd_exec(fb, cmdbuf);
 		if (ret != FASTBOOT_CMD_FALLTHROUGH)
-- 
2.39.2




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-03 11:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 10:00 [PATCH] fastboot: explain use of struct fastboot::cmd_exec/flash Ahmad Fatoum
2024-04-03 11:30 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox