]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Input: synaptics_usb - refactor endpoint lookup
authorJohan Hovold <johan@kernel.org>
Mon, 30 Mar 2026 09:59:47 +0000 (11:59 +0200)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 30 Mar 2026 23:54:41 +0000 (16:54 -0700)
Use the common USB helper for looking up interrupt-in endpoints instead
of open coding.

Signed-off-by: Johan Hovold <johan@kernel.org>
Link: https://patch.msgid.link/20260330095948.1663141-4-johan@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/mouse/synaptics_usb.c

index 5a86f6f387d833fced42937b13fb32951fadf721..880a0c79148cd90d02cbe3e5d9bf7cb9741bfbcd 100644 (file)
@@ -220,25 +220,6 @@ resubmit:
                        __func__, error);
 }
 
-static struct usb_endpoint_descriptor *
-synusb_get_in_endpoint(struct usb_host_interface *iface)
-{
-
-       struct usb_endpoint_descriptor *endpoint;
-       int i;
-
-       for (i = 0; i < iface->desc.bNumEndpoints; ++i) {
-               endpoint = &iface->endpoint[i].desc;
-
-               if (usb_endpoint_is_int_in(endpoint)) {
-                       /* we found our interrupt in endpoint */
-                       return endpoint;
-               }
-       }
-
-       return NULL;
-}
-
 static int synusb_open(struct input_dev *dev)
 {
        struct synusb *synusb = input_get_drvdata(dev);
@@ -307,8 +288,8 @@ static int synusb_probe(struct usb_interface *intf,
                return error;
        }
 
-       ep = synusb_get_in_endpoint(intf->cur_altsetting);
-       if (!ep)
+       error = usb_find_int_in_endpoint(intf->cur_altsetting, &ep);
+       if (error)
                return -ENODEV;
 
        synusb = kzalloc_obj(*synusb);