Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Johan Hovold and committed by
Dmitry Torokhov
a7675c1f 734fd5ba

+2 -20
+2 -20
drivers/input/misc/keyspan_remote.c
··· 420 420 usb_kill_urb(remote->irq_urb); 421 421 } 422 422 423 - static struct usb_endpoint_descriptor *keyspan_get_in_endpoint(struct usb_host_interface *iface) 424 - { 425 - 426 - struct usb_endpoint_descriptor *endpoint; 427 - int i; 428 - 429 - for (i = 0; i < iface->desc.bNumEndpoints; ++i) { 430 - endpoint = &iface->endpoint[i].desc; 431 - 432 - if (usb_endpoint_is_int_in(endpoint)) { 433 - /* we found our interrupt in endpoint */ 434 - return endpoint; 435 - } 436 - } 437 - 438 - return NULL; 439 - } 440 - 441 423 /* 442 424 * Routine that sets up the driver to handle a specific USB device detected on the bus. 443 425 */ ··· 431 449 struct input_dev *input_dev; 432 450 int i, error; 433 451 434 - endpoint = keyspan_get_in_endpoint(interface->cur_altsetting); 435 - if (!endpoint) 452 + error = usb_find_int_in_endpoint(interface->cur_altsetting, &endpoint); 453 + if (error) 436 454 return -ENODEV; 437 455 438 456 remote = kzalloc_obj(*remote);