USB: serial: mos7840: 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: Paul Schroeder <pschroeder@uplogix.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
8110598484
commit
0643c72435
|
@ -434,6 +434,7 @@ static void mos7840_control_callback(struct urb *urb)
|
||||||
struct moschip_port *mos7840_port;
|
struct moschip_port *mos7840_port;
|
||||||
__u8 regval = 0x0;
|
__u8 regval = 0x0;
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
int status = urb->status;
|
||||||
|
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
dbg("%s", "Invalid Pointer !!!!:\n");
|
dbg("%s", "Invalid Pointer !!!!:\n");
|
||||||
|
@ -442,7 +443,7 @@ static void mos7840_control_callback(struct urb *urb)
|
||||||
|
|
||||||
mos7840_port = (struct moschip_port *)urb->context;
|
mos7840_port = (struct moschip_port *)urb->context;
|
||||||
|
|
||||||
switch (urb->status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
/* success */
|
/* success */
|
||||||
break;
|
break;
|
||||||
|
@ -451,11 +452,11 @@ static void mos7840_control_callback(struct urb *urb)
|
||||||
case -ESHUTDOWN:
|
case -ESHUTDOWN:
|
||||||
/* this urb is terminated, clean up */
|
/* this urb is terminated, clean up */
|
||||||
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
|
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
|
||||||
urb->status);
|
status);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
|
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
|
||||||
urb->status);
|
status);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -521,6 +522,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
|
||||||
__u8 sp[5], st;
|
__u8 sp[5], st;
|
||||||
int i, rv = 0;
|
int i, rv = 0;
|
||||||
__u16 wval, wreg = 0;
|
__u16 wval, wreg = 0;
|
||||||
|
int status = urb->status;
|
||||||
|
|
||||||
dbg("%s", " : Entering\n");
|
dbg("%s", " : Entering\n");
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
|
@ -528,7 +530,7 @@ static void mos7840_interrupt_callback(struct urb *urb)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (urb->status) {
|
switch (status) {
|
||||||
case 0:
|
case 0:
|
||||||
/* success */
|
/* success */
|
||||||
break;
|
break;
|
||||||
|
@ -537,11 +539,11 @@ static void mos7840_interrupt_callback(struct urb *urb)
|
||||||
case -ESHUTDOWN:
|
case -ESHUTDOWN:
|
||||||
/* this urb is terminated, clean up */
|
/* this urb is terminated, clean up */
|
||||||
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
|
dbg("%s - urb shutting down with status: %d", __FUNCTION__,
|
||||||
urb->status);
|
status);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
|
dbg("%s - nonzero urb status received: %d", __FUNCTION__,
|
||||||
urb->status);
|
status);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -666,20 +668,21 @@ static struct usb_serial *mos7840_get_usb_serial(struct usb_serial_port *port,
|
||||||
|
|
||||||
static void mos7840_bulk_in_callback(struct urb *urb)
|
static void mos7840_bulk_in_callback(struct urb *urb)
|
||||||
{
|
{
|
||||||
int status;
|
int retval;
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
struct usb_serial *serial;
|
struct usb_serial *serial;
|
||||||
struct usb_serial_port *port;
|
struct usb_serial_port *port;
|
||||||
struct moschip_port *mos7840_port;
|
struct moschip_port *mos7840_port;
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
|
int status = urb->status;
|
||||||
|
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
dbg("%s", "Invalid Pointer !!!!:\n");
|
dbg("%s", "Invalid Pointer !!!!:\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urb->status) {
|
if (status) {
|
||||||
dbg("nonzero read bulk status received: %d", urb->status);
|
dbg("nonzero read bulk status received: %d", status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -729,11 +732,11 @@ static void mos7840_bulk_in_callback(struct urb *urb)
|
||||||
|
|
||||||
mos7840_port->read_urb->dev = serial->dev;
|
mos7840_port->read_urb->dev = serial->dev;
|
||||||
|
|
||||||
status = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
|
retval = usb_submit_urb(mos7840_port->read_urb, GFP_ATOMIC);
|
||||||
|
|
||||||
if (status) {
|
if (retval) {
|
||||||
dbg(" usb_submit_urb(read bulk) failed, status = %d",
|
dbg(" usb_submit_urb(read bulk) failed, retval = %d",
|
||||||
status);
|
retval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -747,6 +750,7 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
|
||||||
{
|
{
|
||||||
struct moschip_port *mos7840_port;
|
struct moschip_port *mos7840_port;
|
||||||
struct tty_struct *tty;
|
struct tty_struct *tty;
|
||||||
|
int status = urb->status;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (!urb) {
|
if (!urb) {
|
||||||
|
@ -764,8 +768,8 @@ static void mos7840_bulk_out_data_callback(struct urb *urb)
|
||||||
}
|
}
|
||||||
spin_unlock(&mos7840_port->pool_lock);
|
spin_unlock(&mos7840_port->pool_lock);
|
||||||
|
|
||||||
if (urb->status) {
|
if (status) {
|
||||||
dbg("nonzero write bulk status received:%d\n", urb->status);
|
dbg("nonzero write bulk status received:%d\n", status);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue