diff options
| author | Alan Stern <[email protected]> | 2022-04-23 21:33:29 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2022-04-26 14:00:15 +0200 |
| commit | 6ebb449f9f25e0da804d1247b4ffcc361321494d (patch) | |
| tree | 7506bc24924d4680225543622867eab2fbc62d59 /include/linux/debugobjects.h | |
| parent | af1969a2d734d6272c0640b50c3ed31e59e203a9 (diff) | |
USB: gadget: Register udc before gadget
In preparation for adding a "gadget" bus, this patch reverses the
order of registration of udc and gadget devices in usb_add_gadget().
The current code adds the gadget device first, probably because that
was more convenient at the time and the order didn't really matter.
But with the upcoming change, adding the gadget will cause driver
probing to occur. Unwinding that on the error pathway will become
much more obtrusive, not to mention the fact that a gadget driver
might not work properly before the udc is registered. It's better to
register the udc device first, particularly since that doesn't involve
a bus or driver binding and therefore is simpler to unwind.
For symmetry, the order of unregistration in usb_del_gadget() is
likewise reversed.
Signed-off-by: Alan Stern <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'include/linux/debugobjects.h')
0 files changed, 0 insertions, 0 deletions