On Mon Mar 30 12:11:39 2026 +0200, Johan Hovold wrote:
> Use the common USB helper for looking up interrupt-in endpoints instead
> of open coding.
>
> Signed-off-by: Johan Hovold <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>
Patch committed.
Thanks,
Hans Verkuil
drivers/media/usb/gspca/gspca.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/drivers/media/usb/gspca/gspca.c b/drivers/media/usb/gspca/gspca.c
index f3d3f441c851..594d73e50b9f 100644
--- a/drivers/media/usb/gspca/gspca.c
+++ b/drivers/media/usb/gspca/gspca.c
@@ -208,22 +208,17 @@ error:
static void gspca_input_create_urb(struct gspca_dev *gspca_dev)
{
struct usb_interface *intf;
- struct usb_host_interface *intf_desc;
struct usb_endpoint_descriptor *ep;
- int i;
+ int ret;
if (gspca_dev->sd_desc->int_pkt_scan) {
intf = usb_ifnum_to_if(gspca_dev->dev, gspca_dev->iface);
- intf_desc = intf->cur_altsetting;
- for (i = 0; i < intf_desc->desc.bNumEndpoints; i++) {
- ep = &intf_desc->endpoint[i].desc;
- if (usb_endpoint_dir_in(ep) &&
- usb_endpoint_xfer_int(ep)) {
- alloc_and_submit_int_urb(gspca_dev, ep);
- break;
- }
- }
+ ret = usb_find_int_in_endpoint(intf->cur_altsetting, &ep);
+ if (ret)
+ return;
+
+ alloc_and_submit_int_urb(gspca_dev, ep);
}
}
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]