]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: serial: add support for multi-port simple drivers
authorJohan Hovold <johan@kernel.org>
Mon, 18 Aug 2014 16:14:52 +0000 (18:14 +0200)
committerJohan Hovold <johan@kernel.org>
Mon, 1 Sep 2014 10:04:27 +0000 (12:04 +0200)
Add support for multi-port simple drivers.

Signed-off-by: Johan Hovold <johan@kernel.org>
drivers/usb/serial/usb-serial-simple.c

index fb79775447b023aa849286856fd85fc0c19ac84e..02cb77a1e79d673837de42435dad54346ea8a773 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/usb.h>
 #include <linux/usb/serial.h>
 
-#define DEVICE(vendor, IDS)                                    \
+#define DEVICE_N(vendor, IDS, nport)                           \
 static const struct usb_device_id vendor##_id_table[] = {      \
        IDS(),                                                  \
        { },                                                    \
@@ -31,9 +31,10 @@ static struct usb_serial_driver vendor##_device = {          \
                .name =         #vendor,                        \
        },                                                      \
        .id_table =             vendor##_id_table,              \
-       .num_ports =            1,                              \
+       .num_ports =            nport,                          \
 };
 
+#define DEVICE(vendor, IDS)    DEVICE_N(vendor, IDS, 1)
 
 /* ZIO Motherboard USB driver */
 #define ZIO_IDS()                      \