summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-09-27 09:49:00 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-27 11:09:27 +0200
commitbc7e00c45bf479258f033a454e3c538d164c4ea5 (patch)
treec37dfbcc4a6239c4ebbfbea5ecf43f8c1da88ee1
parentbf03086f1aa66abd50d440db7895dfd535095e0c (diff)
downloadbarebox-bc7e00c45bf479258f033a454e3c538d164c4ea5.tar.gz
usbgadget: do not register when no functions present
registering a multifunction device makes only sense when there's at least one function configured. Just return otherwise. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/usb/gadget/autostart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/usb/gadget/autostart.c b/drivers/usb/gadget/autostart.c
index 3fa4313..a27be89 100644
--- a/drivers/usb/gadget/autostart.c
+++ b/drivers/usb/gadget/autostart.c
@@ -55,6 +55,10 @@ static int usbgadget_autostart(void)
opts->create_acm = acm;
+ if (!opts->fastboot_opts.files && !opts->create_acm) {
+ pr_warn("No functions to register\n");
+ return 0;
+ }
ret = usb_multi_register(opts);
if (ret)