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

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

+2 -11
+2 -11
drivers/usb/serial/iuu_phoenix.c
··· 68 68 u32 clk; 69 69 }; 70 70 71 - static int iuu_attach(struct usb_serial *serial) 72 - { 73 - unsigned char num_ports = serial->num_ports; 74 - 75 - if (serial->num_bulk_in < num_ports || serial->num_bulk_out < num_ports) 76 - return -ENODEV; 77 - 78 - return 0; 79 - } 80 - 81 71 static int iuu_port_probe(struct usb_serial_port *port) 82 72 { 83 73 struct iuu_private *priv; ··· 1173 1183 }, 1174 1184 .id_table = id_table, 1175 1185 .num_ports = 1, 1186 + .num_bulk_in = 1, 1187 + .num_bulk_out = 1, 1176 1188 .bulk_in_size = 512, 1177 1189 .bulk_out_size = 512, 1178 1190 .open = iuu_open, ··· 1185 1193 .tiocmset = iuu_tiocmset, 1186 1194 .set_termios = iuu_set_termios, 1187 1195 .init_termios = iuu_init_termios, 1188 - .attach = iuu_attach, 1189 1196 .port_probe = iuu_port_probe, 1190 1197 .port_remove = iuu_port_remove, 1191 1198 };