]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
USB: serial: fix stringify operator in usb-serial-simple
authorYann Droneaud <ydroneaud@opteya.com>
Sun, 18 Aug 2013 19:29:00 +0000 (21:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Aug 2013 20:11:06 +0000 (13:11 -0700)
usb-serial-simple uses an unknown stringify macro that make
all drivers being named "stringify(vendor)".

This can be a problem when two drivers have the same (wrong) name:

    kernel: usbcore: registered new interface driver usb_serial_simple
    kernel: usbserial: USB Serial support registered for stringify(vendor)
    kernel Error: Driver 'stringify(vendor)' is already registered, aborting...
    kernel: usbserial: problem -16 when registering driver stringify(vendor)
    kernel: usbserial: USB Serial deregistering driver stringify(vendor)
    kernel: usbcore: deregistering interface driver usb_serial_simple

Before the fix:

    $ strings drivers/usb/serial/usb-serial-simple.o
    usb_serial_simple
    stringify(vendor)

After the fix:

    $ strings drivers/usb/serial/usb-serial-simple.o
    usb_serial_simple
    funsoft
    flashloader
    vivopay
    moto_modem
    hp4x
    suunto
    siemens_mpi

This patch makes usb-serial-simple use the correct stringify operator.

Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/serial/usb-serial-simple.c

index 6a06131f48f45644314ca94f6b28363348140dc8..52eb91f2eb2a4ea662faff97822d68355c296e16 100644 (file)
@@ -29,7 +29,7 @@ static const struct usb_device_id vendor##_id_table[] = {     \
 static struct usb_serial_driver vendor##_device = {            \
        .driver = {                                             \
                .owner =        THIS_MODULE,                    \
-               .name =         "stringify(vendor)",            \
+               .name =         #vendor,                        \
        },                                                      \
        .id_table =             vendor##_id_table,              \
        .num_ports =            1,                              \