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.

mfd: dln2: Automatically detect and fill endpoint pointers

The usb_find_common_endpoints() finds and fills the endpoints
in accordance with their types. Use it to automatically detect
and fill endpoint pointers.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20220617182338.32402-1-andriy.shevchenko@linux.intel.com

authored by

Andy Shevchenko and committed by
Lee Jones
99a7ec2f 7e47943c

+4 -13
+4 -13
drivers/mfd/dln2.c
··· 91 91 spinlock_t lock; 92 92 }; 93 93 94 - enum dln2_endpoint { 95 - DLN2_EP_OUT = 0, 96 - DLN2_EP_IN = 1, 97 - }; 98 - 99 94 struct dln2_dev { 100 95 struct usb_device *usb_dev; 101 96 struct usb_interface *interface; ··· 772 777 int ret; 773 778 int i, j; 774 779 775 - if (hostif->desc.bInterfaceNumber != 0 || 776 - hostif->desc.bNumEndpoints < 2) 780 + if (hostif->desc.bInterfaceNumber != 0) 777 781 return -ENODEV; 778 782 779 - epout = &hostif->endpoint[DLN2_EP_OUT].desc; 780 - if (!usb_endpoint_is_bulk_out(epout)) 781 - return -ENODEV; 782 - epin = &hostif->endpoint[DLN2_EP_IN].desc; 783 - if (!usb_endpoint_is_bulk_in(epin)) 784 - return -ENODEV; 783 + ret = usb_find_common_endpoints(hostif, &epin, &epout, NULL, NULL); 784 + if (ret) 785 + return ret; 785 786 786 787 dln2 = kzalloc(sizeof(*dln2), GFP_KERNEL); 787 788 if (!dln2)