All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] usb: gadget: udc: core: Warn about failed to find udc
@ 2020-01-04 13:27 Dejin Zheng
  0 siblings, 0 replies; only message in thread
From: Dejin Zheng @ 2020-01-04 13:27 UTC (permalink / raw)
  To: balbi, gregkh, stern, rogerq; +Cc: linux-usb, linux-kernel, Dejin Zheng

If we do not warn here, the user may not know failed to
find udc device by a gadget driver with the same name
because it silently fails. Let's print a warning in that
case so developers find these problems faster.

Signed-off-by: Dejin Zheng <zhengdejin5@gmail.com>
---

V2: fix some mistake in comments.

 drivers/usb/gadget/udc/core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index 51fa614b4079..9b11046480fe 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1414,6 +1414,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
 	}
 
 	mutex_unlock(&udc_lock);
+	if (ret)
+		pr_warn("udc-core: couldn't find an available UDC or it's busy\n");
 	return ret;
 found:
 	ret = udc_bind_to_driver(udc, driver);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-04 13:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-04 13:27 [PATCH v2] usb: gadget: udc: core: Warn about failed to find udc Dejin Zheng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.