X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=kernel%2Fdrivers%2Fusb%2Fserial%2Fiuu_phoenix.c;fp=kernel%2Fdrivers%2Fusb%2Fserial%2Fiuu_phoenix.c;h=7ed7d33d6c10e6c695f9e37f5b7b58a27b2c89d7;hb=52f993b8e89487ec9ee15a7fb4979e0f09a45b27;hp=5ad4a0fb4b26ff67380b00e5023ca24e77078266;hpb=c189ccac5702322ed843fe17057035b7222a59b6;p=kvmfornfv.git diff --git a/kernel/drivers/usb/serial/iuu_phoenix.c b/kernel/drivers/usb/serial/iuu_phoenix.c index 5ad4a0fb4..7ed7d33d6 100644 --- a/kernel/drivers/usb/serial/iuu_phoenix.c +++ b/kernel/drivers/usb/serial/iuu_phoenix.c @@ -68,6 +68,16 @@ struct iuu_private { u32 clk; }; +static int iuu_attach(struct usb_serial *serial) +{ + unsigned char num_ports = serial->num_ports; + + if (serial->num_bulk_in < num_ports || serial->num_bulk_out < num_ports) + return -ENODEV; + + return 0; +} + static int iuu_port_probe(struct usb_serial_port *port) { struct iuu_private *priv; @@ -1196,6 +1206,7 @@ static struct usb_serial_driver iuu_device = { .tiocmset = iuu_tiocmset, .set_termios = iuu_set_termios, .init_termios = iuu_init_termios, + .attach = iuu_attach, .port_probe = iuu_port_probe, .port_remove = iuu_port_remove, };