From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH] fastboot: explain use of struct fastboot::cmd_exec/flash
Date: Tue, 2 Apr 2024 12:00:06 +0200 [thread overview]
Message-ID: <20240402100006.2484309-1-a.fatoum@pengutronix.de> (raw)
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
next reply other threads:[~2024-04-02 10:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-02 10:00 Ahmad Fatoum [this message]
2024-04-03 11:30 ` Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240402100006.2484309-1-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox