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>
This commit is contained in:
@@ -40,7 +40,8 @@ static int visor_open(struct tty_struct *tty, struct usb_serial_port *port);
|
||||
static void visor_close(struct usb_serial_port *port);
|
||||
static int visor_probe(struct usb_serial *serial,
|
||||
const struct usb_device_id *id);
|
||||
static int visor_calc_num_ports(struct usb_serial *serial);
|
||||
static int visor_calc_num_ports(struct usb_serial *serial,
|
||||
struct usb_serial_endpoints *epds);
|
||||
static void visor_read_int_callback(struct urb *urb);
|
||||
static int clie_3_5_startup(struct usb_serial *serial);
|
||||
static int treo_attach(struct usb_serial *serial);
|
||||
@@ -466,7 +467,8 @@ static int visor_probe(struct usb_serial *serial,
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int visor_calc_num_ports(struct usb_serial *serial)
|
||||
static int visor_calc_num_ports(struct usb_serial *serial,
|
||||
struct usb_serial_endpoints *epds)
|
||||
{
|
||||
int num_ports = (int)(long)(usb_get_serial_data(serial));
|
||||
|
||||
|
Reference in New Issue
Block a user