Skip to content

Commit

Permalink
hso: remove some dead code
Browse files Browse the repository at this point in the history
It seems like this function was intended to have special handling for
urb statuses of -ENOENT and -ECONNRESET.  But now it just prints some
debugging and returns at the start of the function.

I have removed the dead code, it's still in the git history if anyone
wants to revive it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Dan Carpenter authored and David S. Miller committed Feb 7, 2014
1 parent ee262ad commit 4ccd0bb
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions drivers/net/usb/hso.c
Original file line number Diff line number Diff line change
Expand Up @@ -1201,42 +1201,32 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb)
struct hso_serial *serial = urb->context;
int status = urb->status;

D4("\n--- Got serial_read_bulk callback %02x ---", status);

/* sanity check */
if (!serial) {
D1("serial == NULL");
return;
} else if (status) {
}
if (status) {
handle_usb_error(status, __func__, serial->parent);
return;
}

D4("\n--- Got serial_read_bulk callback %02x ---", status);
D1("Actual length = %d\n", urb->actual_length);
DUMP1(urb->transfer_buffer, urb->actual_length);

/* Anyone listening? */
if (serial->port.count == 0)
return;

if (status == 0) {
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
/* Valid data, handle RX data */
spin_lock(&serial->serial_lock);
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
put_rxbuf_data_and_resubmit_bulk_urb(serial);
spin_unlock(&serial->serial_lock);
} else if (status == -ENOENT || status == -ECONNRESET) {
/* Unlinked - check for throttled port. */
D2("Port %d, successfully unlinked urb", serial->minor);
spin_lock(&serial->serial_lock);
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 0;
hso_resubmit_rx_bulk_urb(serial, urb);
spin_unlock(&serial->serial_lock);
} else {
D2("Port %d, status = %d for read urb", serial->minor, status);
return;
}
if (serial->parent->port_spec & HSO_INFO_CRC_BUG)
fix_crc_bug(urb, serial->in_endp->wMaxPacketSize);
/* Valid data, handle RX data */
spin_lock(&serial->serial_lock);
serial->rx_urb_filled[hso_urb_to_index(serial, urb)] = 1;
put_rxbuf_data_and_resubmit_bulk_urb(serial);
spin_unlock(&serial->serial_lock);
}

/*
Expand Down

0 comments on commit 4ccd0bb

Please sign in to comment.