Thread (34 messages) 34 messages, 3 authors, 2020-12-24

Re: [Linux-kernel-mentees] [PATCH 13/15] usb: serial: iuu_phoenix: use usb_control_msg_send()

From: Johan Hovold <johan@kernel.org>
Date: 2020-12-04 10:28:51
Also in: linux-usb, lkml

On Wed, Nov 04, 2020 at 12:17:01PM +0530, Himadri Pandya wrote:
quoted hunk ↗ jump to hunk
The new usb_control_msg_send() nicely wraps usb_control_msg() with proper
error check. Hence use the wrapper instead of calling usb_control_msg()
directly.

Signed-off-by: Himadri Pandya <redacted>
---
 drivers/usb/serial/iuu_phoenix.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/serial/iuu_phoenix.c b/drivers/usb/serial/iuu_phoenix.c
index b4ba79123d9d..dfbcdcec94e7 100644
--- a/drivers/usb/serial/iuu_phoenix.c
+++ b/drivers/usb/serial/iuu_phoenix.c
@@ -968,9 +968,8 @@ static int iuu_open(struct tty_struct *tty, struct usb_serial_port *port)
 	priv->poll = 0;
 
 #define SOUP(a, b, c, d)  do { \
-	result = usb_control_msg(port->serial->dev,	\
-				usb_sndctrlpipe(port->serial->dev, 0),	\
-				b, a, c, d, NULL, 0, 1000); \
+	result = usb_control_msg_send(port->serial->dev, 0, b, a, c, d, NULL,\
+				      0, 1000, GFP_KERNEL);		     \
No need to for this either even if the result was used for anything else
but logging (since there's no data stage).
 	dev_dbg(dev, "0x%x:0x%x:0x%x:0x%x  %d\n", a, b, c, d, result); } while (0)
 
 	/*  This is not UART related but IUU USB driver related or something */
Please drop.

Johan
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help