greybus: es1-ap-usb: don't protest when getting -EPROTO USB errors
authorGreg Kroah-Hartman <greg@kroah.com>
Fri, 12 Dec 2014 22:10:18 +0000 (17:10 -0500)
committerGreg Kroah-Hartman <greg@kroah.com>
Sat, 13 Dec 2014 18:35:33 +0000 (13:35 -0500)
-EPROTO happens when devices are starting to go away in a system, or
there is something wrong on the USB connection.  Either way, it's safe
to resubmit the urb for this error, don't complain to userspace about
this, as the user will see this for every device removed, which looks
scary, but means nothing.

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Reviewed-by: Alex Elder <elder@linaro.org>
drivers/staging/greybus/es1-ap-usb.c

index 41f56da..27416e4 100644 (file)
@@ -352,7 +352,7 @@ static void svc_in_callback(struct urb *urb)
        int retval;
 
        if (status) {
-               if (status == -EAGAIN)
+               if ((status == -EAGAIN) || (status == -EPROTO))
                        goto exit;
                dev_err(dev, "urb svc in error %d (dropped)\n", status);
                return;
@@ -380,7 +380,7 @@ static void cport_in_callback(struct urb *urb)
        u8 *data;
 
        if (status) {
-               if (status == -EAGAIN)
+               if ((status == -EAGAIN) || (status == -EPROTO))
                        goto exit;
                dev_err(dev, "urb cport in error %d (dropped)\n", status);
                return;