media: ir_toy: do not resubmit broken urb
This causes the same urb to resubmitted continuously, hogging up a cpu. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
1d37c85425
commit
92f461517d
@ -213,10 +213,20 @@ static void irtoy_in_callback(struct urb *urb)
|
||||
struct irtoy *irtoy = urb->context;
|
||||
int ret;
|
||||
|
||||
if (urb->status == 0)
|
||||
switch (urb->status) {
|
||||
case 0:
|
||||
irtoy_response(irtoy, urb->actual_length);
|
||||
else
|
||||
break;
|
||||
case -ECONNRESET:
|
||||
case -ENOENT:
|
||||
case -ESHUTDOWN:
|
||||
case -EPROTO:
|
||||
case -EPIPE:
|
||||
usb_unlink_urb(urb);
|
||||
return;
|
||||
default:
|
||||
dev_dbg(irtoy->dev, "in urb status: %d\n", urb->status);
|
||||
}
|
||||
|
||||
ret = usb_submit_urb(urb, GFP_ATOMIC);
|
||||
if (ret && ret != -ENODEV)
|
||||
|
Loading…
Reference in New Issue
Block a user