On Mon Mar 30 12:11:41 2026 +0200, Johan Hovold wrote:
> Use the common USB helper for looking up bulk-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/s2255/s2255drv.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

---

diff --git a/drivers/media/usb/s2255/s2255drv.c 
b/drivers/media/usb/s2255/s2255drv.c
index 2c02873d09b5..0b8182edf8e4 100644
--- a/drivers/media/usb/s2255/s2255drv.c
+++ b/drivers/media/usb/s2255/s2255drv.c
@@ -2240,18 +2240,14 @@ static int s2255_probe(struct usb_interface *interface,
        iface_desc = interface->cur_altsetting;
        dev_dbg(&interface->dev, "num EP: %d\n",
                iface_desc->desc.bNumEndpoints);
-       for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
-               endpoint = &iface_desc->endpoint[i].desc;
-               if (!dev->read_endpoint && usb_endpoint_is_bulk_in(endpoint)) {
-                       /* we found the bulk in endpoint */
-                       dev->read_endpoint = endpoint->bEndpointAddress;
-               }
-       }
 
-       if (!dev->read_endpoint) {
+       if (usb_find_bulk_in_endpoint(iface_desc, &endpoint)) {
                dev_err(&interface->dev, "Could not find bulk-in endpoint\n");
                goto errorEP;
        }
+
+       dev->read_endpoint = endpoint->bEndpointAddress;
+
        timer_setup(&dev->timer, s2255_timer, 0);
        init_waitqueue_head(&dev->fw_data->wait_fw);
        for (i = 0; i < MAX_CHANNELS; i++) {
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to