On Mon Mar 30 12:11:37 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: Sean Young <[email protected]>

Patch committed.

Thanks,
Sean Young

 drivers/media/rc/imon_raw.c | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

---

diff --git a/drivers/media/rc/imon_raw.c b/drivers/media/rc/imon_raw.c
index 3a526dea6532..295acd6ba9e1 100644
--- a/drivers/media/rc/imon_raw.c
+++ b/drivers/media/rc/imon_raw.c
@@ -105,26 +105,16 @@ static void imon_ir_rx(struct urb *urb)
 static int imon_probe(struct usb_interface *intf,
                      const struct usb_device_id *id)
 {
-       struct usb_endpoint_descriptor *ir_ep = NULL;
-       struct usb_host_interface *idesc;
+       struct usb_endpoint_descriptor *ir_ep;
        struct usb_device *udev;
        struct rc_dev *rcdev;
        struct imon *imon;
-       int i, ret;
+       int ret;
 
        udev = interface_to_usbdev(intf);
-       idesc = intf->cur_altsetting;
-
-       for (i = 0; i < idesc->desc.bNumEndpoints; i++) {
-               struct usb_endpoint_descriptor *ep = &idesc->endpoint[i].desc;
-
-               if (usb_endpoint_is_int_in(ep)) {
-                       ir_ep = ep;
-                       break;
-               }
-       }
 
-       if (!ir_ep) {
+       ret = usb_find_int_in_endpoint(intf->cur_altsetting, &ir_ep);
+       if (ret) {
                dev_err(&intf->dev, "IR endpoint missing");
                return -ENODEV;
        }
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to