summaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial/sierra.c
diff options
context:
space:
mode:
authorJohan Hovold2017-03-16 17:13:30 +0100
committerJohan Hovold2017-03-28 10:54:39 +0200
commit07814246dd5530860ef758fd9b2b5f2e26472aa2 (patch)
treee27c9ae087d22c49b063e365df2c7f2ba479c253 /drivers/usb/serial/sierra.c
parentUSB: serial: whiteheat: simplify endpoint check (diff)
downloadkernel-qcow2-linux-07814246dd5530860ef758fd9b2b5f2e26472aa2.tar.gz
kernel-qcow2-linux-07814246dd5530860ef758fd9b2b5f2e26472aa2.tar.xz
kernel-qcow2-linux-07814246dd5530860ef758fd9b2b5f2e26472aa2.zip
USB: serial: allow subdrivers to modify port-endpoint mapping
Allow subdrivers to modify the port-endpoint mapping by passing the endpoint descriptors to calc_num_ports. The callback can now also be used to verify that the required endpoints exists and abort probing otherwise. This will allow us to get rid of a few hacks in subdrivers that are already modifying the port-endpoint mapping (or aborting probe due to missing endpoints), but only after the port structures have been setup. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/sierra.c')
-rw-r--r--drivers/usb/serial/sierra.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
index 465e851b2815..4c4ac4705ac0 100644
--- a/drivers/usb/serial/sierra.c
+++ b/drivers/usb/serial/sierra.c
@@ -85,7 +85,8 @@ static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable)
USB_CTRL_SET_TIMEOUT); /* int timeout */
}
-static int sierra_calc_num_ports(struct usb_serial *serial)
+static int sierra_calc_num_ports(struct usb_serial *serial,
+ struct usb_serial_endpoints *epds)
{
int num_ports = 0;
u8 ifnum, numendpoints;