summaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-12-07 10:36:07 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-12-07 11:25:26 +0100
commitb2f3f9c1023e675de845cd2641947429a6e8905f (patch)
tree479de1b8d32553ecdc4ff79a351c20f335dcdd6b /drivers/usb
parent305b9fb5ef06140685d403a95da4cf55d4cfca64 (diff)
downloadbarebox-b2f3f9c1023e675de845cd2641947429a6e8905f.tar.gz
barebox-b2f3f9c1023e675de845cd2641947429a6e8905f.tar.xz
usb: gadget: fastboot: be more informative on booting
We used to end the fastboot session once we received the boot command. Now that we end the session during shutdown we can do better: We can end the session once we actually shutdown, or more importantly in the case of an error. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/f_fastboot.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 08ea9bce6b..f6eb30dec4 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -759,7 +759,7 @@ static void cb_download(struct f_fastboot *f_fb, const char *cmd)
}
}
-static void do_bootm_on_complete(struct usb_ep *ep, struct usb_request *req)
+static void __maybe_unused cb_boot(struct f_fastboot *f_fb, const char *opt)
{
int ret;
struct bootm_data data = {
@@ -767,7 +767,7 @@ static void do_bootm_on_complete(struct usb_ep *ep, struct usb_request *req)
.os_address = UIMAGE_SOME_ADDRESS,
};
- pr_info("Booting kernel..\n");
+ fastboot_tx_print(f_fb, FASTBOOT_MSG_INFO, "Booting kernel..\n");
globalvar_set_match("linux.bootargs.dyn.", "");
globalvar_set_match("bootm.", "");
@@ -775,14 +775,12 @@ static void do_bootm_on_complete(struct usb_ep *ep, struct usb_request *req)
data.os_file = xstrdup(FASTBOOT_TMPFILE);
ret = bootm_boot(&data);
- if (ret)
- pr_err("Booting failed\n");
-}
-static void __maybe_unused cb_boot(struct f_fastboot *f_fb, const char *opt)
-{
- f_fb->in_req->complete = do_bootm_on_complete;
- fastboot_tx_print(f_fb, FASTBOOT_MSG_OKAY, "");
+ if (ret)
+ fastboot_tx_print(f_fb, FASTBOOT_MSG_FAIL, "Booting failed: %s",
+ strerror(-ret));
+ else
+ fastboot_tx_print(f_fb, FASTBOOT_MSG_OKAY, "");
}
static struct mtd_info *get_mtd(struct f_fastboot *f_fb, const char *filename)