diff mbox series

[08/13] usb: gadget: Use dbg_ep0() macro instead of serial_printf()

Message ID 20201129164957.6019-1-pali@kernel.org
State New
Delegated to: Marek Vasut
Headers show
Series Nokia RX-51: Fix USB TTY console and enable it | expand

Commit Message

Pali Rohár Nov. 29, 2020, 4:49 p.m. UTC
All debug messages from ep0.c except a few are printed by dbg_ep0() macro.
So for remaining few exception use also dbg_ep0() instead of serial_printf().

Signed-off-by: Pali Rohár <pali@kernel.org>
---
 drivers/usb/gadget/ep0.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

Comments

Pavel Machek Nov. 29, 2020, 5:57 p.m. UTC | #1
On Sun 2020-11-29 17:49:52, Pali Rohár wrote:
> All debug messages from ep0.c except a few are printed by dbg_ep0() macro.
> So for remaining few exception use also dbg_ep0() instead of serial_printf().
> 
> Signed-off-by: Pali Rohár <pali@kernel.org>

Reviewed-by: Pavel Machek <pavel@ucw.cz>
diff mbox series

Patch

diff --git a/drivers/usb/gadget/ep0.c b/drivers/usb/gadget/ep0.c
index 2b15a508c5..aafe2680aa 100644
--- a/drivers/usb/gadget/ep0.c
+++ b/drivers/usb/gadget/ep0.c
@@ -279,7 +279,7 @@  static int ep0_get_descriptor (struct usb_device_instance *device,
 		{
 			struct usb_string_descriptor *string_descriptor;
 			if (!(string_descriptor = usbd_get_string (index))) {
-				serial_printf("Invalid string index %d\n", index);
+				dbg_ep0(0, "Invalid string index %d\n", index);
 				return -1;
 			}
 			dbg_ep0(3, "string_descriptor: %p length %d", string_descriptor, string_descriptor->bLength);
@@ -287,14 +287,14 @@  static int ep0_get_descriptor (struct usb_device_instance *device,
 		}
 		break;
 	case USB_DESCRIPTOR_TYPE_INTERFACE:
-	serial_printf("USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_INTERFACE - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_ENDPOINT:
-		serial_printf("USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
+		dbg_ep0(2, "USB_DESCRIPTOR_TYPE_ENDPOINT - error not implemented\n");
 		return -1;
 	case USB_DESCRIPTOR_TYPE_HID:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_HID - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -323,7 +323,7 @@  static int ep0_get_descriptor (struct usb_device_instance *device,
 		break;
 	case USB_DESCRIPTOR_TYPE_REPORT:
 		{
-			serial_printf("USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
+			dbg_ep0(2, "USB_DESCRIPTOR_TYPE_REPORT - error not implemented\n");
 			return -1;	/* unsupported at this time */
 #if 0
 			int bNumInterface =
@@ -516,7 +516,7 @@  int ep0_recv_setup (struct urb *urb)
 						   le16_to_cpu (request->wValue) & 0xff);
 
 		case USB_REQ_GET_CONFIGURATION:
-			serial_printf("get config %d\n", device->configuration);
+			dbg_ep0(2, "get config %d\n", device->configuration);
 			return ep0_get_one (device, urb,
 					    device->configuration);
 
@@ -606,14 +606,14 @@  int ep0_recv_setup (struct urb *urb)
 			device->interface = device->alternate = 0;
 
 			/*dbg_ep0(2, "set configuration: %d", device->configuration); */
-			/*serial_printf("DEVICE_CONFIGURED.. event?\n"); */
+			/*dbg_ep0(2, "DEVICE_CONFIGURED.. event?\n"); */
 			return 0;
 
 		case USB_REQ_SET_INTERFACE:
 			device->interface = le16_to_cpu (request->wIndex);
 			device->alternate = le16_to_cpu (request->wValue);
 			/*dbg_ep0(2, "set interface: %d alternate: %d", device->interface, device->alternate); */
-			serial_printf("DEVICE_SET_INTERFACE.. event?\n");
+			dbg_ep0(2, "DEVICE_SET_INTERFACE.. event?\n");
 			return 0;
 
 		case USB_REQ_GET_STATUS: