]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - drivers/usb/gadget/udc/core.c
usb: gadget: udc-core: independent registration of gadgets and gadget drivers
authorRuslan Bilovol <ruslan.bilovol@gmail.com>
Mon, 23 Nov 2015 08:56:38 +0000 (09:56 +0100)
committerFelipe Balbi <balbi@ti.com>
Wed, 16 Dec 2015 16:07:27 +0000 (10:07 -0600)
commit855ed04a3758b205e84b269f92d26ab36ed8e2f7
tree79fb82c138731d9028f09368c04669ab4008f62a
parent88f73ebdfa75602af18e070a4d5d6d9091bcfada
usb: gadget: udc-core: independent registration of gadgets and gadget drivers

Change behavior during registration of gadgets and
gadget drivers in udc-core. Instead of previous
approach when for successful probe of usb gadget driver
at least one usb gadget should be already registered
use another one where gadget drivers and gadgets
can be registered in udc-core independently.

Independent registration of gadgets and gadget drivers
is useful for built-in into kernel gadget and gadget
driver case - because it's possible that gadget is
really probed only on late_init stage (due to deferred
probe) whereas gadget driver's probe is silently failed
on module_init stage due to no any UDC added.

Also it is useful for modules case - now there is no
difference what module to insert first: gadget module
or gadget driver one.

Tested-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: Ruslan Bilovol <ruslan.bilovol@gmail.com>
[simplified code as requested by Alan Stern and Felipe Balbi,
 fixed checkpatch issues]
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/gadget/udc/udc-core.c
include/linux/usb/gadget.h