summaryrefslogtreecommitdiff
path: root/drivers/usb/serial/omninet.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-03-02 14:51:28 +0300
committerJohan Hovold <johan@kernel.org>2017-03-16 12:33:45 +0300
commit8ee1592d125a95dc8a554398e014b65ee04cd80c (patch)
tree5c87189b9fbf2f3e11e915797ce27ca42d4ada57 /drivers/usb/serial/omninet.c
parent206ff831bebb816087da29a34fcff5bd603602e1 (diff)
downloadlinux-8ee1592d125a95dc8a554398e014b65ee04cd80c.tar.xz
USB: serial: omninet: simplify endpoint check
Simplify the endpoint sanity check by letting core verify that the required endpoints are present. Note that the driver uses the second bulk-out endpoint for writing. Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers/usb/serial/omninet.c')
-rw-r--r--drivers/usb/serial/omninet.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c
index dd706953b466..7be40dfa3620 100644
--- a/drivers/usb/serial/omninet.c
+++ b/drivers/usb/serial/omninet.c
@@ -37,7 +37,6 @@ static int omninet_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count);
static int omninet_write_room(struct tty_struct *tty);
static void omninet_disconnect(struct usb_serial *serial);
-static int omninet_attach(struct usb_serial *serial);
static int omninet_port_probe(struct usb_serial_port *port);
static int omninet_port_remove(struct usb_serial_port *port);
@@ -56,7 +55,7 @@ static struct usb_serial_driver zyxel_omninet_device = {
.description = "ZyXEL - omni.net lcd plus usb",
.id_table = id_table,
.num_ports = 1,
- .attach = omninet_attach,
+ .num_bulk_out = 2,
.port_probe = omninet_port_probe,
.port_remove = omninet_port_remove,
.write = omninet_write,
@@ -104,17 +103,6 @@ struct omninet_data {
__u8 od_outseq; /* Sequence number for bulk_out URBs */
};
-static int omninet_attach(struct usb_serial *serial)
-{
- /* The second bulk-out endpoint is used for writing. */
- if (serial->num_bulk_out < 2) {
- dev_err(&serial->interface->dev, "missing endpoints\n");
- return -ENODEV;
- }
-
- return 0;
-}
-
static int omninet_port_probe(struct usb_serial_port *port)
{
struct omninet_data *od;