Skip to content

Commit 4decd8f

Browse files
jhovolddtor
authored andcommitted
Input: synaptics_usb - 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-4-johan@kernel.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
1 parent 5bb3ab0 commit 4decd8f

1 file changed

Lines changed: 2 additions & 21 deletions

File tree

drivers/input/mouse/synaptics_usb.c

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -220,25 +220,6 @@ static void synusb_irq(struct urb *urb)
220220
__func__, error);
221221
}
222222

223-
static struct usb_endpoint_descriptor *
224-
synusb_get_in_endpoint(struct usb_host_interface *iface)
225-
{
226-
227-
struct usb_endpoint_descriptor *endpoint;
228-
int i;
229-
230-
for (i = 0; i < iface->desc.bNumEndpoints; ++i) {
231-
endpoint = &iface->endpoint[i].desc;
232-
233-
if (usb_endpoint_is_int_in(endpoint)) {
234-
/* we found our interrupt in endpoint */
235-
return endpoint;
236-
}
237-
}
238-
239-
return NULL;
240-
}
241-
242223
static int synusb_open(struct input_dev *dev)
243224
{
244225
struct synusb *synusb = input_get_drvdata(dev);
@@ -307,8 +288,8 @@ static int synusb_probe(struct usb_interface *intf,
307288
return error;
308289
}
309290

310-
ep = synusb_get_in_endpoint(intf->cur_altsetting);
311-
if (!ep)
291+
error = usb_find_int_in_endpoint(intf->cur_altsetting, &ep);
292+
if (error)
312293
return -ENODEV;
313294

314295
synusb = kzalloc_obj(*synusb);

0 commit comments

Comments
 (0)