linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/2] usb: gadget: udc: core: Use pr_fmt() to prefix messages
@ 2021-10-04 14:41 Andy Shevchenko
  2021-10-04 14:41 ` [PATCH v1 2/2] usb: gadget: udc: core: Print error code in usb_gadget_probe_driver() Andy Shevchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Shevchenko @ 2021-10-04 14:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Felipe Balbi, Andy Shevchenko

Instead of duplicating, use pr_fmt() to prefix pr_*() messages.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/gadget/udc/core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index 14fdf918ecfe..f66ac6f8011e 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -6,6 +6,8 @@
  * Author: Felipe Balbi <balbi@ti.com>
  */
 
+#define pr_fmt(fmt)	"UDC core: " fmt
+
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/device.h>
@@ -1555,14 +1557,14 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
 
 	if (!driver->match_existing_only) {
 		list_add_tail(&driver->pending, &gadget_driver_pending_list);
-		pr_info("udc-core: couldn't find an available UDC - added [%s] to list of pending drivers\n",
+		pr_info("couldn't find an available UDC - added [%s] to list of pending drivers\n",
 			driver->function);
 		ret = 0;
 	}
 
 	mutex_unlock(&udc_lock);
 	if (ret)
-		pr_warn("udc-core: couldn't find an available UDC or it's busy\n");
+		pr_warn("couldn't find an available UDC or it's busy\n");
 	return ret;
 found:
 	ret = udc_bind_to_driver(udc, driver);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v1 2/2] usb: gadget: udc: core: Print error code in usb_gadget_probe_driver()
  2021-10-04 14:41 [PATCH v1 1/2] usb: gadget: udc: core: Use pr_fmt() to prefix messages Andy Shevchenko
@ 2021-10-04 14:41 ` Andy Shevchenko
  0 siblings, 0 replies; 2+ messages in thread
From: Andy Shevchenko @ 2021-10-04 14:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman, linux-usb, linux-kernel; +Cc: Felipe Balbi, Andy Shevchenko

When the UDC is not found, print also the error code for easier debugging.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/gadget/udc/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/core.c b/drivers/usb/gadget/udc/core.c
index f66ac6f8011e..d6265118647b 100644
--- a/drivers/usb/gadget/udc/core.c
+++ b/drivers/usb/gadget/udc/core.c
@@ -1564,7 +1564,7 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver)
 
 	mutex_unlock(&udc_lock);
 	if (ret)
-		pr_warn("couldn't find an available UDC or it's busy\n");
+		pr_warn("couldn't find an available UDC or it's busy: %d\n", ret);
 	return ret;
 found:
 	ret = udc_bind_to_driver(udc, driver);
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-04 14:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-04 14:41 [PATCH v1 1/2] usb: gadget: udc: core: Use pr_fmt() to prefix messages Andy Shevchenko
2021-10-04 14:41 ` [PATCH v1 2/2] usb: gadget: udc: core: Print error code in usb_gadget_probe_driver() Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).