Commit 4f329c04 authored by Paul Fox's avatar Paul Fox Committed by John W. Linville

libertas: Communicate USB transfer errors

The return code was being overwritten with -1.
Useful for debugging.
Signed-off-by: default avatarPaul Fox <pgf@laptop.org>
Signed-off-by: default avatarDaniel Drake <dsd@laptop.org>
Acked-by: default avatarDan Williams <dcbw@redhat.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent d4659912
...@@ -484,11 +484,12 @@ static int if_usb_reset_device(struct if_usb_card *cardp) ...@@ -484,11 +484,12 @@ static int if_usb_reset_device(struct if_usb_card *cardp)
*/ */
static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb) static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb)
{ {
int ret = -1; int ret;
/* check if device is removed */ /* check if device is removed */
if (cardp->surprise_removed) { if (cardp->surprise_removed) {
lbs_deb_usbd(&cardp->udev->dev, "Device removed\n"); lbs_deb_usbd(&cardp->udev->dev, "Device removed\n");
ret = -ENODEV;
goto tx_ret; goto tx_ret;
} }
...@@ -501,7 +502,6 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb ...@@ -501,7 +502,6 @@ static int usb_tx_block(struct if_usb_card *cardp, uint8_t *payload, uint16_t nb
if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) { if ((ret = usb_submit_urb(cardp->tx_urb, GFP_ATOMIC))) {
lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret); lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret);
ret = -1;
} else { } else {
lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n"); lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n");
ret = 0; ret = 0;
......
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