summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2026-03-30 13:11:41 +0300
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-05-05 17:57:02 +0300
commitfe90217607fc82010713aa5eb4d2518300fefe6a (patch)
treee01b83a17f93e8edc7787c140e5c5f339be06f04
parentb8b6b2bf0ee0c9d175e80effac6698e82739b7dc (diff)
downloadlinux-fe90217607fc82010713aa5eb4d2518300fefe6a.tar.xz
media: s2255: refactor endpoint lookup
Use the common USB helper for looking up bulk-in endpoints instead of open coding. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
-rw-r--r--drivers/media/usb/s2255/s2255drv.c12
1 files 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++) {