Commit a3ea410c authored by Takashi Iwai's avatar Takashi Iwai Committed by Mauro Carvalho Chehab

media: go7007: Fix URB type for interrupt handling

Josef reported that his old-and-good Plextor ConvertX M402U video
converter spews lots of WARNINGs on the recent kernels, and it turned
out that the device uses a bulk endpoint for interrupt handling just
like 2250 board.

For fixing it, generalize the check with the proper verification of
the endpoint instead of hard-coded board type check.

Fixes: 7e5219d1 ("[media] go7007: Fix 2250 urb type")
Reported-and-tested-by: default avatarJosef Möllers <josef.moellers@suse.com>
BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1162583
BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206427Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent d77182ad
...@@ -1044,6 +1044,7 @@ static int go7007_usb_probe(struct usb_interface *intf, ...@@ -1044,6 +1044,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
struct go7007_usb *usb; struct go7007_usb *usb;
const struct go7007_usb_board *board; const struct go7007_usb_board *board;
struct usb_device *usbdev = interface_to_usbdev(intf); struct usb_device *usbdev = interface_to_usbdev(intf);
struct usb_host_endpoint *ep;
unsigned num_i2c_devs; unsigned num_i2c_devs;
char *name; char *name;
int video_pipe, i, v_urb_len; int video_pipe, i, v_urb_len;
...@@ -1140,7 +1141,8 @@ static int go7007_usb_probe(struct usb_interface *intf, ...@@ -1140,7 +1141,8 @@ static int go7007_usb_probe(struct usb_interface *intf,
if (usb->intr_urb->transfer_buffer == NULL) if (usb->intr_urb->transfer_buffer == NULL)
goto allocfail; goto allocfail;
if (go->board_id == GO7007_BOARDID_SENSORAY_2250) ep = usb->usbdev->ep_in[4];
if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK)
usb_fill_bulk_urb(usb->intr_urb, usb->usbdev, usb_fill_bulk_urb(usb->intr_urb, usb->usbdev,
usb_rcvbulkpipe(usb->usbdev, 4), usb_rcvbulkpipe(usb->usbdev, 4),
usb->intr_urb->transfer_buffer, 2*sizeof(u16), usb->intr_urb->transfer_buffer, 2*sizeof(u16),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment