summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Keeping <jkeeping@inmusicbrands.com>2024-09-13 12:23:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-04 15:28:43 +0200
commitdf9158826b00e53f42c67d62c887a84490d80a0a (patch)
treedd3b3c06acb418aa34fb9850a1e2b10c5051f0cc
parentLinux 6.12-rc1 (diff)
downloadlinux-df9158826b00e53f42c67d62c887a84490d80a0a.tar.xz
linux-df9158826b00e53f42c67d62c887a84490d80a0a.zip
usb: gadget: core: force synchronous registration
Registering a gadget driver is expected to complete synchronously and immediately after calling driver_register() this function checks that the driver has bound so as to return an error. Set PROBE_FORCE_SYNCHRONOUS to ensure this is the case even when asynchronous probing is set as the default. Fixes: fc274c1e99731 ("USB: gadget: Add a new bus for gadgets") Cc: stable@vger.kernel.org Signed-off-by: John Keeping <jkeeping@inmusicbrands.com> Link: https://lore.kernel.org/r/20240913102325.2826261-1-jkeeping@inmusicbrands.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/gadget/udc/core.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index cf6478f97f4a..a6f46364be65 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1696,6 +1696,7 @@ int usb_gadget_register_driver_owner(struct usb_gadget_driver *driver,
driver->driver.bus = &gadget_bus_type;
driver->driver.owner = owner;
driver->driver.mod_name = mod_name;
+ driver->driver.probe_type = PROBE_FORCE_SYNCHRONOUS;
ret = driver_register(&driver->driver);
if (ret) {
pr_warn("%s: driver registration failed: %d\n",