2010-10-13 19:32:33

by Daniel Drake

[permalink] [raw]
Subject: [PATCH] libertas: Communicate USB transfer errors

From: Paul Fox <[email protected]>

The return code was being overwritten with -1.
Useful for debugging.

Signed-off-by: Paul Fox <[email protected]>
Signed-off-by: Daniel Drake <[email protected]>
---
drivers/net/wireless/libertas/if_usb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
index 3ff6106..16e2575 100644
--- a/drivers/net/wireless/libertas/if_usb.c
+++ b/drivers/net/wireless/libertas/if_usb.c
@@ -472,11 +472,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)
{
- int ret = -1;
+ int ret;

/* check if device is removed */
if (cardp->surprise_removed) {
lbs_deb_usbd(&cardp->udev->dev, "Device removed\n");
+ ret = -ENODEV;
goto tx_ret;
}

@@ -489,7 +490,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))) {
lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret);
- ret = -1;
} else {
lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n");
ret = 0;
--
1.7.2.3



2010-10-14 15:55:58

by Dan Williams

[permalink] [raw]
Subject: Re: [PATCH] libertas: Communicate USB transfer errors

On Wed, 2010-10-13 at 20:14 +0100, Daniel Drake wrote:
> From: Paul Fox <[email protected]>
>
> The return code was being overwritten with -1.
> Useful for debugging.
>
> Signed-off-by: Paul Fox <[email protected]>
> Signed-off-by: Daniel Drake <[email protected]>

Acked-by: Dan Williams <[email protected]>

> ---
> drivers/net/wireless/libertas/if_usb.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c
> index 3ff6106..16e2575 100644
> --- a/drivers/net/wireless/libertas/if_usb.c
> +++ b/drivers/net/wireless/libertas/if_usb.c
> @@ -472,11 +472,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)
> {
> - int ret = -1;
> + int ret;
>
> /* check if device is removed */
> if (cardp->surprise_removed) {
> lbs_deb_usbd(&cardp->udev->dev, "Device removed\n");
> + ret = -ENODEV;
> goto tx_ret;
> }
>
> @@ -489,7 +490,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))) {
> lbs_deb_usbd(&cardp->udev->dev, "usb_submit_urb failed: %d\n", ret);
> - ret = -1;
> } else {
> lbs_deb_usb2(&cardp->udev->dev, "usb_submit_urb success\n");
> ret = 0;