Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: serial: kobil_sct: 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>

+1 -12
+1 -12
drivers/usb/serial/kobil_sct.c
··· 51 51 52 52 53 53 /* Function prototypes */ 54 - static int kobil_attach(struct usb_serial *serial); 55 54 static int kobil_port_probe(struct usb_serial_port *probe); 56 55 static int kobil_port_remove(struct usb_serial_port *probe); 57 56 static int kobil_open(struct tty_struct *tty, struct usb_serial_port *port); ··· 86 87 .description = "KOBIL USB smart card terminal", 87 88 .id_table = id_table, 88 89 .num_ports = 1, 89 - .attach = kobil_attach, 90 + .num_interrupt_out = 1, 90 91 .port_probe = kobil_port_probe, 91 92 .port_remove = kobil_port_remove, 92 93 .ioctl = kobil_ioctl, ··· 113 114 __u16 device_type; 114 115 }; 115 116 116 - 117 - static int kobil_attach(struct usb_serial *serial) 118 - { 119 - if (serial->num_interrupt_out < serial->num_ports) { 120 - dev_err(&serial->interface->dev, "missing interrupt-out endpoint\n"); 121 - return -ENODEV; 122 - } 123 - 124 - return 0; 125 - } 126 117 127 118 static int kobil_port_probe(struct usb_serial_port *port) 128 119 {