usb: udc: Try to clarify an error message
authorMiquel Raynal <miquel.raynal@bootlin.com>
Tue, 10 Oct 2023 09:03:04 +0000 (11:03 +0200)
committerMattijs Korpershoek <mkorpershoek@baylibre.com>
Tue, 21 Nov 2023 14:48:38 +0000 (15:48 +0100)
commit8a0d07807abb5370fe879321c7f1d22fdda3255f
tree77d01d0e9d3b58c01f6d2ed22b154426e5c4af4e
parent249a75d8e82b422639beedca3d7d945cd78869ba
usb: udc: Try to clarify an error message

At some point when trying to use USB gadgets, two situations may arise
and lead to a failure. Either the UDC (USB Device Controller) is not
available at all (not described or not probed) or the UDC is already in
use. For instance, as the USB Ethernet gadget remains bound to the UDC,
the use of any other USB gadget (fastboot, dfu, etc) *after* will always
fail with the "couldn't find an available UDC" error.

Let's give a more helpful message by making a difference between the two
cases. Let's also hint people who would get this error and grep it into
the sources a better explanation of what's wrong with their workflow.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20231010090304.49335-4-miquel.raynal@bootlin.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
drivers/usb/gadget/udc/udc-core.c