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

USB: serial: cyberjack: 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 -10
+1 -10
drivers/usb/serial/cyberjack.c
··· 50 50 #define CYBERJACK_PRODUCT_ID 0x0100 51 51 52 52 /* Function prototypes */ 53 - static int cyberjack_attach(struct usb_serial *serial); 54 53 static int cyberjack_port_probe(struct usb_serial_port *port); 55 54 static int cyberjack_port_remove(struct usb_serial_port *port); 56 55 static int cyberjack_open(struct tty_struct *tty, ··· 77 78 .description = "Reiner SCT Cyberjack USB card reader", 78 79 .id_table = id_table, 79 80 .num_ports = 1, 80 - .attach = cyberjack_attach, 81 + .num_bulk_out = 1, 81 82 .port_probe = cyberjack_port_probe, 82 83 .port_remove = cyberjack_port_remove, 83 84 .open = cyberjack_open, ··· 100 101 short wrfilled; /* Overall data size we already got */ 101 102 short wrsent; /* Data already sent */ 102 103 }; 103 - 104 - static int cyberjack_attach(struct usb_serial *serial) 105 - { 106 - if (serial->num_bulk_out < serial->num_ports) 107 - return -ENODEV; 108 - 109 - return 0; 110 - } 111 104 112 105 static int cyberjack_port_probe(struct usb_serial_port *port) 113 106 {