We can only register one USB multi gadget, so check for it being already registered and print a meaningful error message if it is. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- drivers/usb/gadget/multi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/gadget/multi.c b/drivers/usb/gadget/multi.c index 13fa622f01..a2cfc8d850 100644 --- a/drivers/usb/gadget/multi.c +++ b/drivers/usb/gadget/multi.c @@ -234,6 +234,11 @@ static struct usb_composite_driver multi_driver = { int usb_multi_register(struct f_multi_opts *opts) { + if (gadget_multi_opts) { + pr_err("USB multi gadget already registered\n"); + return -EBUSY; + } + gadget_multi_opts = opts; return usb_composite_probe(&multi_driver); -- 2.11.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox