From: Malcolm Priestley Date: Tue, 25 Feb 2014 20:51:48 +0000 (+0000) Subject: staging: vt6656: s_nsBulkInUsbIoCompleteRead Replace error handling. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=67638980eff396300e20ca5c152f33844827ffb7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git staging: vt6656: s_nsBulkInUsbIoCompleteRead Replace error handling. Use switch on urb->status Signed-off-by: Malcolm Priestley Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 87601b7b984c..1cab7a321bf6 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -473,21 +473,22 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb) DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"---->s_nsBulkInUsbIoCompleteRead\n"); - if (urb->status) { - pDevice->ulBulkInError++; - DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO"BULK In failed %d\n", urb->status); -//todo...xxxxxx -// if (status == USBD_STATUS_CRC) { -// pDevice->ulBulkInContCRCError++; -// } -// if (status == STATUS_DEVICE_NOT_CONNECTED ) -// { -// MP_SET_FLAG(pDevice, fMP_DISCONNECTED); -// } - } else { - pDevice->ulBulkInContCRCError = 0; - pDevice->ulBulkInBytesRead += urb->actual_length; - } + switch (urb->status) { + case 0: + pDevice->ulBulkInContCRCError = 0; + pDevice->ulBulkInBytesRead += urb->actual_length; + break; + case -ECONNRESET: + case -ENOENT: + case -ESHUTDOWN: + return; + case -ETIMEDOUT: + default: + pDevice->ulBulkInError++; + DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO + "BULK In failed %d\n", urb->status); + break; + } if (urb->actual_length) { spin_lock(&pDevice->lock);