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

USB: serial: option: clean up urb->status usage

This done in anticipation of removal of urb->status, which will make
that patch easier to review and apply in the future.


Cc: <linux-usb-devel@lists.sourceforge.net>
Cc: Matthias Urlichs <smurf@smurf.noris.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent fdc2deb3
...@@ -416,15 +416,16 @@ static void option_indat_callback(struct urb *urb) ...@@ -416,15 +416,16 @@ static void option_indat_callback(struct urb *urb)
struct usb_serial_port *port; struct usb_serial_port *port;
struct tty_struct *tty; struct tty_struct *tty;
unsigned char *data = urb->transfer_buffer; unsigned char *data = urb->transfer_buffer;
int status = urb->status;
dbg("%s: %p", __FUNCTION__, urb); dbg("%s: %p", __FUNCTION__, urb);
endpoint = usb_pipeendpoint(urb->pipe); endpoint = usb_pipeendpoint(urb->pipe);
port = (struct usb_serial_port *) urb->context; port = (struct usb_serial_port *) urb->context;
if (urb->status) { if (status) {
dbg("%s: nonzero status: %d on endpoint %02x.", dbg("%s: nonzero status: %d on endpoint %02x.",
__FUNCTION__, urb->status, endpoint); __FUNCTION__, status, endpoint);
} else { } else {
tty = port->tty; tty = port->tty;
if (urb->actual_length) { if (urb->actual_length) {
...@@ -436,7 +437,7 @@ static void option_indat_callback(struct urb *urb) ...@@ -436,7 +437,7 @@ static void option_indat_callback(struct urb *urb)
} }
/* Resubmit urb so we continue receiving */ /* Resubmit urb so we continue receiving */
if (port->open_count && urb->status != -ESHUTDOWN) { if (port->open_count && status != -ESHUTDOWN) {
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) if (err)
printk(KERN_ERR "%s: resubmit read urb failed. " printk(KERN_ERR "%s: resubmit read urb failed. "
...@@ -471,6 +472,7 @@ static void option_outdat_callback(struct urb *urb) ...@@ -471,6 +472,7 @@ static void option_outdat_callback(struct urb *urb)
static void option_instat_callback(struct urb *urb) static void option_instat_callback(struct urb *urb)
{ {
int err; int err;
int status = urb->status;
struct usb_serial_port *port = (struct usb_serial_port *) urb->context; struct usb_serial_port *port = (struct usb_serial_port *) urb->context;
struct option_port_private *portdata = usb_get_serial_port_data(port); struct option_port_private *portdata = usb_get_serial_port_data(port);
struct usb_serial *serial = port->serial; struct usb_serial *serial = port->serial;
...@@ -478,7 +480,7 @@ static void option_instat_callback(struct urb *urb) ...@@ -478,7 +480,7 @@ static void option_instat_callback(struct urb *urb)
dbg("%s", __FUNCTION__); dbg("%s", __FUNCTION__);
dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata); dbg("%s: urb %p port %p has data %p", __FUNCTION__,urb,port,portdata);
if (urb->status == 0) { if (status == 0) {
struct usb_ctrlrequest *req_pkt = struct usb_ctrlrequest *req_pkt =
(struct usb_ctrlrequest *)urb->transfer_buffer; (struct usb_ctrlrequest *)urb->transfer_buffer;
...@@ -509,10 +511,10 @@ static void option_instat_callback(struct urb *urb) ...@@ -509,10 +511,10 @@ static void option_instat_callback(struct urb *urb)
req_pkt->bRequestType,req_pkt->bRequest); req_pkt->bRequestType,req_pkt->bRequest);
} }
} else } else
dbg("%s: error %d", __FUNCTION__, urb->status); dbg("%s: error %d", __FUNCTION__, status);
/* Resubmit urb so we continue receiving IRQ data */ /* Resubmit urb so we continue receiving IRQ data */
if (urb->status != -ESHUTDOWN) { if (status != -ESHUTDOWN) {
urb->dev = serial->dev; urb->dev = serial->dev;
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err) if (err)
......
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