diff options
author | Johan Hovold <johan@kernel.org> | 2017-03-02 12:51:32 +0100 |
---|---|---|
committer | Johan Hovold <johan@kernel.org> | 2017-03-16 10:33:46 +0100 |
commit | bdd154436077391e40fd20be8ff384d4002b3970 (patch) | |
tree | 05448d5721306051aa89db780a0c9107b7060557 | |
parent | 590298b2232503ee5088c3abfe6cf69d51ade427 (diff) | |
download | op-kernel-dev-bdd154436077391e40fd20be8ff384d4002b3970.zip op-kernel-dev-bdd154436077391e40fd20be8ff384d4002b3970.tar.gz |
USB: serial: spcp8x5: simplify endpoint check
Simplify the endpoint sanity check by letting core verify that the
required endpoints are present.
Signed-off-by: Johan Hovold <johan@kernel.org>
-rw-r--r-- | drivers/usb/serial/spcp8x5.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index ddfd787..5167b65 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c @@ -154,19 +154,6 @@ static int spcp8x5_probe(struct usb_serial *serial, return 0; } -static int spcp8x5_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) { - dev_err(&serial->interface->dev, "missing endpoints\n"); - return -ENODEV; - } - - return 0; -} - static int spcp8x5_port_probe(struct usb_serial_port *port) { const struct usb_device_id *id = usb_get_serial_data(port->serial); @@ -488,6 +475,8 @@ static struct usb_serial_driver spcp8x5_device = { }, .id_table = id_table, .num_ports = 1, + .num_bulk_in = 1, + .num_bulk_out = 1, .open = spcp8x5_open, .dtr_rts = spcp8x5_dtr_rts, .carrier_raised = spcp8x5_carrier_raised, @@ -496,7 +485,6 @@ static struct usb_serial_driver spcp8x5_device = { .tiocmget = spcp8x5_tiocmget, .tiocmset = spcp8x5_tiocmset, .probe = spcp8x5_probe, - .attach = spcp8x5_attach, .port_probe = spcp8x5_port_probe, .port_remove = spcp8x5_port_remove, }; |