[PATCH master 3/3] usb: gadget: return error on missing UDC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Recent sync with kernel added the match_existing_only member, but set it
no where, leading to usb_gadget_register_driver succeeding on missing
UDC. This used to be an error and we depend on it, e.g.
global.usbgadget.autostart=1 is a no-op once usb_composite_probe has
succeeded, but if we signal success in error cases, it can't be used
to retry registration.

Fixes: 14211ab8b0e1 ("usb: gadget: Update core to Linux-6.3-rc2")
Signed-off-by: Ahmad Fatoum <a.fatoum@xxxxxxxxxxxxxx>
---
 drivers/usb/gadget/composite.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 58c10f1191f8..f55ae5698e08 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -2496,6 +2496,7 @@ int usb_composite_probe(struct usb_composite_driver *driver)
 	gadget_driver->function =  (char *) driver->name;
 	gadget_driver->driver.name = driver->name;
 	gadget_driver->max_speed = driver->max_speed;
+	gadget_driver->match_existing_only = true;
 
 	return usb_gadget_register_driver(gadget_driver);
 }
-- 
2.39.2





[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux