summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2026-03-30 11:59:45 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2026-03-30 16:54:41 -0700
commita7675c1f1fa38c559f267b0452ae9d7a736fa743 (patch)
treee6be18c0d6164e5626071ef7380ac2c2209c9214 /drivers
parent734fd5ba78cb079ba1873336387da8cb4df60403 (diff)
Input: keyspan-remote - refactor endpoint lookup
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-2-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/input/misc/keyspan_remote.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/drivers/input/misc/keyspan_remote.c b/drivers/input/misc/keyspan_remote.c
index 152633bd2266..70cd6586459e 100644
--- a/drivers/input/misc/keyspan_remote.c
+++ b/drivers/input/misc/keyspan_remote.c
@@ -420,24 +420,6 @@ static void keyspan_close(struct input_dev *dev)
usb_kill_urb(remote->irq_urb);
}
-static struct usb_endpoint_descriptor *keyspan_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;
-}
-
/*
* Routine that sets up the driver to handle a specific USB device detected on the bus.
*/
@@ -449,8 +431,8 @@ static int keyspan_probe(struct usb_interface *interface, const struct usb_devic
struct input_dev *input_dev;
int i, error;
- endpoint = keyspan_get_in_endpoint(interface->cur_altsetting);
- if (!endpoint)
+ error = usb_find_int_in_endpoint(interface->cur_altsetting, &endpoint);
+ if (error)
return -ENODEV;
remote = kzalloc_obj(*remote);