]> xenbits.xensource.com Git - people/aperard/linux-chromebook.git/commitdiff
CHROMIUM: USB: option: don't show error when urb is killed in an expected way
authorBen Chan <benchan@chromium.org>
Thu, 21 Feb 2013 01:33:43 +0000 (17:33 -0800)
committerBen Chan <benchan@chromium.org>
Mon, 25 Feb 2013 17:41:48 +0000 (09:41 -0800)
When a device supported by the option driver is suspended, the interrupt
urb is killed and option_instat_callback() is invoked with the urb's
status set to -ENOENT. The patch prevents the option driver from
spamming the log with a message 'option_instat_callback: error -2' under
such scenario.

BUG=chrome-os-partner:17918
TEST=Tested the following on link:
1. Put the system on battery so that USB auto-suspend is turned on for
   the Novatel E362 modem.
2. Verify that the option kernel drive no longer prints the following
   error to /var/log/messages:

       option: option_instat_callback: error -2

(cherry picked from commit b09ec140d31136176eee94bfb49f46eb7cf2ffda)

Change-Id: I6e286a3cbf4087a88a06682f8b32d45109d84364
Signed-off-by: Ben Chan <benchan@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/43907

drivers/usb/serial/option.c

index fca6217c4c73e988865319df94991c763268bbea..e2d495132b213bffd23533be86c4f47497c8dc18 100644 (file)
@@ -1446,7 +1446,7 @@ static void option_instat_callback(struct urb *urb)
                        dbg("%s: type %x req %x", __func__,
                                req_pkt->bRequestType, req_pkt->bRequest);
                }
-       } else
+       } else if (status != -ESHUTDOWN && status != -ENOENT)
                err("%s: error %d", __func__, status);
 
        /* Resubmit urb so we continue receiving IRQ data */