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: 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>

authored by

Johan Hovold and committed by
Dmitry Torokhov
4decd8f4 5bb3ab0d

+2 -21
+2 -21
drivers/input/mouse/synaptics_usb.c
··· 220 220 __func__, error); 221 221 } 222 222 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 - 242 223 static int synusb_open(struct input_dev *dev) 243 224 { 244 225 struct synusb *synusb = input_get_drvdata(dev); ··· 288 307 return error; 289 308 } 290 309 291 - ep = synusb_get_in_endpoint(intf->cur_altsetting); 292 - if (!ep) 310 + error = usb_find_int_in_endpoint(intf->cur_altsetting, &ep); 311 + if (error) 293 312 return -ENODEV; 294 313 295 314 synusb = kzalloc_obj(*synusb);