Commit f5683a63 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

USB keyspan_pda.c : fix problems found by CHECKER

pay attention to the return value of usb_control_msg as found by the CHECKER tool.
parent dc9094be
...@@ -194,11 +194,12 @@ static void keyspan_pda_wakeup_write( struct usb_serial_port *port ) ...@@ -194,11 +194,12 @@ static void keyspan_pda_wakeup_write( struct usb_serial_port *port )
static void keyspan_pda_request_unthrottle( struct usb_serial *serial ) static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
{ {
int result;
dbg(" request_unthrottle"); dbg(" request_unthrottle");
/* ask the device to tell us when the tx buffer becomes /* ask the device to tell us when the tx buffer becomes
sufficiently empty */ sufficiently empty */
usb_control_msg(serial->dev, result = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), usb_sndctrlpipe(serial->dev, 0),
7, /* request_unthrottle */ 7, /* request_unthrottle */
USB_TYPE_VENDOR | USB_RECIP_INTERFACE USB_TYPE_VENDOR | USB_RECIP_INTERFACE
...@@ -208,6 +209,9 @@ static void keyspan_pda_request_unthrottle( struct usb_serial *serial ) ...@@ -208,6 +209,9 @@ static void keyspan_pda_request_unthrottle( struct usb_serial *serial )
NULL, NULL,
0, 0,
2*HZ); 2*HZ);
if (result < 0)
dbg("%s - error %d from usb_control_msg",
__FUNCTION__, result);
} }
...@@ -334,14 +338,19 @@ static void keyspan_pda_break_ctl (struct usb_serial_port *port, int break_state ...@@ -334,14 +338,19 @@ static void keyspan_pda_break_ctl (struct usb_serial_port *port, int break_state
{ {
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
int value; int value;
int result;
if (break_state == -1) if (break_state == -1)
value = 1; /* start break */ value = 1; /* start break */
else else
value = 0; /* clear break */ value = 0; /* clear break */
usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), result = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
4, /* set break */ 4, /* set break */
USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT, USB_TYPE_VENDOR | USB_RECIP_INTERFACE | USB_DIR_OUT,
value, 0, NULL, 0, 2*HZ); value, 0, NULL, 0, 2*HZ);
if (result < 0)
dbg("%s - error %d from usb_control_msg",
__FUNCTION__, result);
/* there is something funky about this.. the TCSBRK that 'cu' performs /* there is something funky about this.. the TCSBRK that 'cu' performs
ought to translate into a break_ctl(-1),break_ctl(0) pair HZ/4 ought to translate into a break_ctl(-1),break_ctl(0) pair HZ/4
seconds apart, but it feels like the break sent isn't as long as it seconds apart, but it feels like the break sent isn't as long as it
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment