mirror of
https://github.com/torvalds/linux.git
synced 2026-05-12 16:18:45 +02:00
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>
This commit is contained in:
parent
734fd5ba78
commit
a7675c1f1f
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user