[PATCH] USB Serial: move name to driver structure
authorGreg Kroah-Hartman <gregkh@suse.de>
Tue, 21 Jun 2005 04:15:16 +0000 (21:15 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 28 Oct 2005 23:47:48 +0000 (16:47 -0700)
This fixes up a lot of problems in sysfs with some of the usb serial
drivers, they had incorrect driver names.  Also saves a tiny ammount
of memory.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
31 files changed:
drivers/usb/serial/airprime.c
drivers/usb/serial/belkin_sa.c
drivers/usb/serial/bus.c
drivers/usb/serial/cp2101.c
drivers/usb/serial/cyberjack.c
drivers/usb/serial/cypress_m8.c
drivers/usb/serial/digi_acceleport.c
drivers/usb/serial/empeg.c
drivers/usb/serial/ftdi_sio.c
drivers/usb/serial/garmin_gps.c
drivers/usb/serial/generic.c
drivers/usb/serial/hp4x.c
drivers/usb/serial/io_tables.h
drivers/usb/serial/io_ti.c
drivers/usb/serial/ipaq.c
drivers/usb/serial/ipw.c
drivers/usb/serial/ir-usb.c
drivers/usb/serial/keyspan.h
drivers/usb/serial/keyspan_pda.c
drivers/usb/serial/kl5kusb105.c
drivers/usb/serial/kobil_sct.c
drivers/usb/serial/mct_u232.c
drivers/usb/serial/omninet.c
drivers/usb/serial/option.c
drivers/usb/serial/pl2303.c
drivers/usb/serial/safe_serial.c
drivers/usb/serial/ti_usb_3410_5052.c
drivers/usb/serial/usb-serial.c
drivers/usb/serial/usb-serial.h
drivers/usb/serial/visor.c
drivers/usb/serial/whiteheat.c

index fbc5b9b447497725547c8effd41b6a3f963e346e..1f29d883732720602336e341fd3cb2490f084cfe 100644 (file)
@@ -33,8 +33,8 @@ static struct usb_driver airprime_driver = {
 static struct usb_serial_driver airprime_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "airprime",
        },
-       .name =                 "airprime",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
index 4878961a0900a0cacc5d5bf9f2b39cf6f085490d..84bc0ee4f0616c890a687259fea73939413589ff 100644 (file)
@@ -124,9 +124,9 @@ static struct usb_driver belkin_driver = {
 static struct usb_serial_driver belkin_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "belkin",
        },
-       .name =                 "Belkin / Peracom / GoHubs USB Serial Adapter",
-       .short_name =           "belkin",
+       .description =          "Belkin / Peracom / GoHubs USB Serial Adapter",
        .id_table =             id_table_combined,
        .num_interrupt_in =     1,
        .num_bulk_in =          1,
index b8364a8de7df485bdabfbeb6d1978feb3ca5f483..664139afcfa9a7a28b09de9fac830592be169fd3 100644 (file)
@@ -72,7 +72,7 @@ static int usb_serial_device_probe (struct device *dev)
        tty_register_device (usb_serial_tty_driver, minor, dev);
        dev_info(&port->serial->dev->dev, 
                 "%s converter now attached to ttyUSB%d\n",
-                driver->name, minor);
+                driver->description, minor);
 
 exit:
        return retval;
@@ -104,7 +104,7 @@ exit:
        minor = port->number;
        tty_unregister_device (usb_serial_tty_driver, minor);
        dev_info(dev, "%s converter now disconnected from ttyUSB%d\n",
-                driver->name, minor);
+                driver->description, minor);
 
        return retval;
 }
@@ -113,10 +113,6 @@ int usb_serial_bus_register(struct usb_serial_driver *driver)
 {
        int retval;
 
-       if (driver->short_name)
-               driver->driver.name = (char *)driver->short_name;
-       else
-               driver->driver.name = (char *)driver->name;
        driver->driver.bus = &usb_serial_bus_type;
        driver->driver.probe = usb_serial_device_probe;
        driver->driver.remove = usb_serial_device_remove;
index 81dd720a122b52781d52f463cc98ed4fb1bd929f..c5334dd89b12baa3ba4f1f02f18e8d002b45452e 100644 (file)
@@ -67,7 +67,7 @@ MODULE_DEVICE_TABLE (usb, id_table);
 
 static struct usb_driver cp2101_driver = {
        .owner          = THIS_MODULE,
-       .name           = "CP2101",
+       .name           = "cp2101",
        .probe          = usb_serial_probe,
        .disconnect     = usb_serial_disconnect,
        .id_table       = id_table,
@@ -76,8 +76,8 @@ static struct usb_driver cp2101_driver = {
 static struct usb_serial_driver cp2101_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "cp2101",
        },
-       .name                   = "CP2101",
        .id_table               = id_table,
        .num_interrupt_in       = 0,
        .num_bulk_in            = 0,
index 3441bad74f7b11d7b63934acf65eb355b34a0c65..e581e4ae84830d82ac65f973c4fb1c781665fa21 100644 (file)
@@ -86,9 +86,9 @@ static struct usb_driver cyberjack_driver = {
 static struct usb_serial_driver cyberjack_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "cyberjack",
        },
-       .name =                 "Reiner SCT Cyberjack USB card reader",
-       .short_name =           "cyberjack",
+       .description =          "Reiner SCT Cyberjack USB card reader",
        .id_table =             id_table,
        .num_interrupt_in =     1,
        .num_bulk_in =          1,
index b4069af4d56589344f3526961aa2c586922b1cf5..af9290ed257bc17b3a5f1762ee1bd0411acb8745 100644 (file)
@@ -179,9 +179,9 @@ static unsigned int   cypress_buf_get(struct cypress_buf *cb, char *buf, unsigne
 static struct usb_serial_driver cypress_earthmate_device = {
        .driver = {
                .owner =                THIS_MODULE,
+               .name =                 "earthmate",
        },
-       .name =                         "DeLorme Earthmate USB",
-       .short_name =                   "earthmate",
+       .description =                  "DeLorme Earthmate USB",
        .id_table =                     id_table_earthmate,
        .num_interrupt_in =             1,
        .num_interrupt_out =            1,
@@ -208,9 +208,9 @@ static struct usb_serial_driver cypress_earthmate_device = {
 static struct usb_serial_driver cypress_hidcom_device = {
        .driver = {
                .owner =                THIS_MODULE,
+               .name =                 "cyphidcom",
        },
-       .name =                         "HID->COM RS232 Adapter",
-       .short_name =                   "cyphidcom",
+       .description =                  "HID->COM RS232 Adapter",
        .id_table =                     id_table_cyphidcomrs232,
        .num_interrupt_in =             1,
        .num_interrupt_out =            1,
index be9b495d2491d83298f553abcb05c9bc023295a8..dc74644a603d6b72b051cd8387abe588515e43ae 100644 (file)
@@ -505,10 +505,10 @@ static struct usb_driver digi_driver = {
 
 static struct usb_serial_driver digi_acceleport_2_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner =                THIS_MODULE,
+               .name =                 "digi_2",
        },
-       .name =                         "Digi 2 port USB adapter",
-       .short_name =                   "digi_2",
+       .description =                  "Digi 2 port USB adapter",
        .id_table =                     id_table_2,
        .num_interrupt_in =             0,
        .num_bulk_in =                  4,
@@ -534,10 +534,10 @@ static struct usb_serial_driver digi_acceleport_2_device = {
 
 static struct usb_serial_driver digi_acceleport_4_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner =                THIS_MODULE,
+               .name =                 "digi_4",
        },
-       .name =                         "Digi 4 port USB adapter",
-       .short_name =                   "digi_4",
+       .description =                  "Digi 4 port USB adapter",
        .id_table =                     id_table_4,
        .num_interrupt_in =             0,
        .num_bulk_in =                  5,
index 3e6c4ba7667b1eba0d86d24e9900ce87f9e5659a..0b0546dcc7b9346a72c5ba0388dfefd064f61908 100644 (file)
@@ -115,8 +115,8 @@ static struct usb_driver empeg_driver = {
 static struct usb_serial_driver empeg_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "empeg",
        },
-       .name =                 "Empeg",
        .id_table =             id_table,
        .num_interrupt_in =     0,
        .num_bulk_in =          1,
index 9d945de0acacbb1abd9ed4bafe2a66f918dbf055..77d54ac39a0e9a873d510f8bbdfd60e9604874b8 100644 (file)
@@ -565,9 +565,9 @@ static __u32 ftdi_232bm_baud_to_divisor (int baud);
 static struct usb_serial_driver ftdi_sio_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "ftdi_sio",
        },
-       .name =                 "FTDI USB Serial Device",
-       .short_name =           "ftdi_sio",
+       .description =          "FTDI USB Serial Device",
        .id_table =             id_table_combined,
        .num_interrupt_in =     0,
        .num_bulk_in =          1,
index 3fd98c00cd6addb38f647613ba1441922a9915e6..35820bda7ae19bfe56b1d33528558f653cafde82 100644 (file)
@@ -1472,9 +1472,9 @@ static void garmin_shutdown (struct usb_serial *serial)
 static struct usb_serial_driver garmin_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "garmin_gps",
        },
-       .name                = "Garmin GPS usb/tty",
-       .short_name          = "garmin_gps",
+       .description =          "Garmin GPS usb/tty",
        .id_table            = id_table,
        .num_interrupt_in    = 1,
        .num_bulk_in         = 1,
index 779bea0c6242dc575edbda7600c97b34e0813a1b..8909208f506ad6384bcbec10f8b4eb1ca42d6713 100644 (file)
@@ -39,9 +39,8 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
 struct usb_serial_driver usb_serial_generic_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "generic",
        },
-       .name =                 "Generic",
-       .short_name =           "generic",
        .id_table =             generic_device_ids,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
index 4f3cbc08c4ee3e6d729717f74c84e5fb6a3f0234..8eadfb70560132a5224567be0804fdacd4d03385 100644 (file)
@@ -38,7 +38,7 @@ MODULE_DEVICE_TABLE(usb, id_table);
 
 static struct usb_driver hp49gp_driver = {
        .owner =        THIS_MODULE,
-       .name =         "HP4X",
+       .name =         "hp4X",
        .probe =        usb_serial_probe,
        .disconnect =   usb_serial_disconnect,
        .id_table =     id_table,
@@ -47,8 +47,8 @@ static struct usb_driver hp49gp_driver = {
 static struct usb_serial_driver hp49gp_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "hp4X",
        },
-       .name =                 "HP4X",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
index 28fb0d42a1662e2b31e73c5a0ee9d8ec90d67c7a..fad561c04c768a120d867e0bed71fdc0439aa086 100644 (file)
@@ -78,9 +78,9 @@ MODULE_DEVICE_TABLE (usb, id_table_combined);
 static struct usb_serial_driver edgeport_2port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "edgeport_2",
        },
-       .name                   = "Edgeport 2 port adapter",
-       .short_name             = "edgeport_2",
+       .description            = "Edgeport 2 port adapter",
        .id_table               = edgeport_2port_id_table,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 1,
@@ -108,9 +108,9 @@ static struct usb_serial_driver edgeport_2port_device = {
 static struct usb_serial_driver edgeport_4port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "edgeport_4",
        },
-       .name                   = "Edgeport 4 port adapter",
-       .short_name             = "edgeport_4",
+       .description            = "Edgeport 4 port adapter",
        .id_table               = edgeport_4port_id_table,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 1,
@@ -138,9 +138,9 @@ static struct usb_serial_driver edgeport_4port_device = {
 static struct usb_serial_driver edgeport_8port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "edgeport_8",
        },
-       .name                   = "Edgeport 8 port adapter",
-       .short_name             = "edgeport_8",
+       .description            = "Edgeport 8 port adapter",
        .id_table               = edgeport_8port_id_table,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 1,
index 74228a072643b3975f41d3593d340c5546a6bfbf..832b6d6734c0f6c1886f2e8ad365234e32dab31c 100644 (file)
@@ -2984,10 +2984,10 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf,
 
 static struct usb_serial_driver edgeport_1port_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner          = THIS_MODULE,
+               .name           = "edgeport_ti_1",
        },
-       .name                   = "Edgeport TI 1 port adapter",
-       .short_name             = "edgeport_ti_1",
+       .description            = "Edgeport TI 1 port adapter",
        .id_table               = edgeport_1port_id_table,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 1,
@@ -3014,10 +3014,10 @@ static struct usb_serial_driver edgeport_1port_device = {
 
 static struct usb_serial_driver edgeport_2port_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner          = THIS_MODULE,
+               .name           = "edgeport_ti_2",
        },
-       .name                   = "Edgeport TI 2 port adapter",
-       .short_name             = "edgeport_ti_2",
+       .description            = "Edgeport TI 2 port adapter",
        .id_table               = edgeport_2port_id_table,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 2,
index 9aedfb91b20cdc58968b1d9ce409ca09b656ab98..1abaebe6dbc1949b2e27df26d01362c492bc641f 100644 (file)
@@ -550,8 +550,9 @@ static struct usb_driver ipaq_driver = {
 static struct usb_serial_driver ipaq_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "ipaq",
        },
-       .name =                 "PocketPC PDA",
+       .description =          "PocketPC PDA",
        .id_table =             ipaq_id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          1,
index 2ba69623ac05bb896417014b713760c8d8597f61..a02fada853620b1b04d0797e9f8b04ae32e179ba 100644 (file)
@@ -446,9 +446,9 @@ static int ipw_disconnect(struct usb_serial_port *port)
 static struct usb_serial_driver ipw_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "ipw",
        },
-       .name =                 "IPWireless converter",
-       .short_name =           "ipw",
+       .description =          "IPWireless converter",
        .id_table =             usb_ipw_ids,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          1,
index bf079059819e0202afd2b8be43b3ff52e92ee870..19f329e9bdcf5afb161dc17e8512a433945b09d3 100644 (file)
@@ -136,8 +136,9 @@ static struct usb_driver ir_driver = {
 static struct usb_serial_driver ir_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "ir-usb",
        },
-       .name =                 "IR Dongle",
+       .description =          "IR Dongle",
        .id_table =             id_table,
        .num_interrupt_in =     1,
        .num_bulk_in =          1,
index 124d46e76a2e464748500110c82034ffd6fd4ddf..5cfc13b5e56f59aecdc14191577aef116a572b70 100644 (file)
@@ -573,9 +573,9 @@ static struct usb_device_id keyspan_4port_ids[] = {
 static struct usb_serial_driver keyspan_pre_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "keyspan_no_firm",
        },
-       .name                   = "Keyspan - (without firmware)",
-       .short_name             = "keyspan_no_firm",
+       .description            = "Keyspan - (without firmware)",
        .id_table               = keyspan_pre_ids,
        .num_interrupt_in       = NUM_DONT_CARE,
        .num_bulk_in            = NUM_DONT_CARE,
@@ -587,9 +587,9 @@ static struct usb_serial_driver keyspan_pre_device = {
 static struct usb_serial_driver keyspan_1port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "keyspan_1",
        },
-       .name                   = "Keyspan 1 port adapter",
-       .short_name             = "keyspan_1",
+       .description            = "Keyspan 1 port adapter",
        .id_table               = keyspan_1port_ids,
        .num_interrupt_in       = NUM_DONT_CARE,
        .num_bulk_in            = NUM_DONT_CARE,
@@ -614,9 +614,9 @@ static struct usb_serial_driver keyspan_1port_device = {
 static struct usb_serial_driver keyspan_2port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "keyspan_2",
        },
-       .name                   = "Keyspan 2 port adapter",
-       .short_name             = "keyspan_2",
+       .description            = "Keyspan 2 port adapter",
        .id_table               = keyspan_2port_ids,
        .num_interrupt_in       = NUM_DONT_CARE,
        .num_bulk_in            = NUM_DONT_CARE,
@@ -641,9 +641,9 @@ static struct usb_serial_driver keyspan_2port_device = {
 static struct usb_serial_driver keyspan_4port_device = {
        .driver = {
                .owner          = THIS_MODULE,
+               .name           = "keyspan_4",
        },
-       .name                   = "Keyspan 4 port adapter",
-       .short_name             = "keyspan_4",
+       .description            = "Keyspan 4 port adapter",
        .id_table               = keyspan_4port_ids,
        .num_interrupt_in       = NUM_DONT_CARE,
        .num_bulk_in            = 5,
index 389b7833e3ae2d2f193ba03c8af03f5d6a60ae1a..cd4f48bd83b614552372d2c5669aa275ba55ccd0 100644 (file)
@@ -786,9 +786,9 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
 static struct usb_serial_driver keyspan_pda_fake_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "keyspan_pda_pre",
        },
-       .name =                 "Keyspan PDA - (prerenumeration)",
-       .short_name =           "keyspan_pda_pre",
+       .description =          "Keyspan PDA - (prerenumeration)",
        .id_table =             id_table_fake,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
@@ -802,9 +802,9 @@ static struct usb_serial_driver keyspan_pda_fake_device = {
 static struct usb_serial_driver xircom_pgs_fake_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "xircom_no_firm",
        },
-       .name =                 "Xircom / Entregra PGS - (prerenumeration)",
-       .short_name =           "xircom_no_firm",
+       .description =          "Xircom / Entregra PGS - (prerenumeration)",
        .id_table =             id_table_fake_xircom,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
@@ -817,9 +817,9 @@ static struct usb_serial_driver xircom_pgs_fake_device = {
 static struct usb_serial_driver keyspan_pda_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "keyspan_pda",
        },
-       .name =                 "Keyspan PDA",
-       .short_name =           "keyspan_pda",
+       .description =          "Keyspan PDA",
        .id_table =             id_table_std,
        .num_interrupt_in =     1,
        .num_bulk_in =          0,
index 586108ce7897b801ad7e0fcf56875afd40c4409b..a8951c0fd0209bdffc6d585715d3f58771a554f7 100644 (file)
@@ -126,9 +126,9 @@ static struct usb_driver kl5kusb105d_driver = {
 static struct usb_serial_driver kl5kusb105d_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "kl5kusb105d",
        },
-       .name =              "KL5KUSB105D / PalmConnect",
-       .short_name =        "kl5kusb105d",
+       .description =       "KL5KUSB105D / PalmConnect",
        .id_table =          id_table,
        .num_interrupt_in =  1,
        .num_bulk_in =       1,
index a9578e05b22fe6e0d8791d28afd3bfafdb1e6fab..9456dd9dd13672047beb7d63cbec7ebdd37cfee5 100644 (file)
@@ -108,8 +108,9 @@ static struct usb_driver kobil_driver = {
 static struct usb_serial_driver kobil_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "kobil",
        },
-       .name =                 "KOBIL USB smart card terminal",
+       .description =          "KOBIL USB smart card terminal",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          0,
index 7dcf91c5f83d6cd4f9ecd634ebb625ec66df330b..ca5dbadb9b7e821c73b4d0fa62ba7435439cf96c 100644 (file)
@@ -135,9 +135,9 @@ static struct usb_driver mct_u232_driver = {
 static struct usb_serial_driver mct_u232_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "mct_u232",
        },
-       .name =              "MCT U232",
-       .short_name =        "mct_u232",
+       .description =       "MCT U232",
        .id_table =          id_table_combined,
        .num_interrupt_in =  2,
        .num_bulk_in =       0,
index f6327cc1b2e7b3ac7e636d91ef4543c27ce354b9..3caf97072ac014947cd036380f1a82ec8e824497 100644 (file)
@@ -91,9 +91,9 @@ static struct usb_driver omninet_driver = {
 static struct usb_serial_driver zyxel_omninet_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "omninet",
        },
-       .name =                 "ZyXEL - omni.net lcd plus usb",
-       .short_name =           "omninet",
+       .description =          "ZyXEL - omni.net lcd plus usb",
        .id_table =             id_table,
        .num_interrupt_in =     1,
        .num_bulk_in =          1,
index a2b5adf34868fc8ecbae0739f4751ef068fcd78f..7716000045b73dd632d41f1104c9696b8d715077 100644 (file)
@@ -108,9 +108,9 @@ static struct usb_driver option_driver = {
 static struct usb_serial_driver option_3port_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "option",
        },
-       .name              = "Option 3G data card",
-       .short_name        = "option",
+       .description       = "Option 3G data card",
        .id_table          = option_ids,
        .num_interrupt_in  = NUM_DONT_CARE,
        .num_bulk_in       = NUM_DONT_CARE,
index 29719ceab19a66993033a3837621fd1180c3cbe4..f8f4e93e8c0bcb64a917baa4f35b7361d518abff 100644 (file)
@@ -157,8 +157,8 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf,
 static struct usb_serial_driver pl2303_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "pl2303",
        },
-       .name =                 "PL-2303",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          1,
index 42a86ab689f4664010131fcea730652bc75a48a5..c22bdc0c4dfde9b02cdc13b490a0d7d6b3b1a446 100644 (file)
@@ -400,8 +400,8 @@ static int safe_startup (struct usb_serial *serial)
 static struct usb_serial_driver safe_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "safe_serial",
        },
-       .name =                 "Safe",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
index eab8a6de0925b21c3fd15151c42f2c33f209dea9..205dbf7201daa27f0fb366195d22798ff7d31fb5 100644 (file)
@@ -257,9 +257,10 @@ static struct usb_driver ti_usb_driver = {
 
 static struct usb_serial_driver ti_1port_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner          = THIS_MODULE,
+               .name           = "ti_usb_3410_5052_1",
        },
-       .name                   = "TI USB 3410 1 port adapter",
+       .description            = "TI USB 3410 1 port adapter",
        .id_table               = ti_id_table_3410,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 1,
@@ -286,9 +287,10 @@ static struct usb_serial_driver ti_1port_device = {
 
 static struct usb_serial_driver ti_2port_device = {
        .driver = {
-               .owner =        THIS_MODULE,
+               .owner          = THIS_MODULE,
+               .name           = "ti_usb_3410_5052_2",
        },
-       .name                   = "TI USB 5052 2 port adapter",
+       .description            = "TI USB 5052 2 port adapter",
        .id_table               = ti_id_table_5052,
        .num_interrupt_in       = 1,
        .num_bulk_in            = 2,
index fde09fba87901fb3f1e64d0ffe1580ed9d4d2c0d..13f6592be685a16479a5edfb8cbd03b6478ca8d9 100644 (file)
@@ -122,7 +122,7 @@ static void destroy_serial(struct kref *kref)
 
        serial = to_usb_serial(kref);
 
-       dbg ("%s - %s", __FUNCTION__, serial->type->name);
+       dbg("%s - %s", __FUNCTION__, serial->type->description);
 
        serial->type->shutdown(serial);
 
@@ -415,7 +415,7 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int
                length += sprintf (page+length, "%d:", i);
                if (serial->type->driver.owner)
                        length += sprintf (page+length, " module:%s", module_name(serial->type->driver.owner));
-               length += sprintf (page+length, " name:\"%s\"", serial->type->name);
+               length += sprintf (page+length, " name:\"%s\"", serial->type->description);
                length += sprintf (page+length, " vendor:%04x product:%04x", 
                                   le16_to_cpu(serial->dev->descriptor.idVendor), 
                                   le16_to_cpu(serial->dev->descriptor.idProduct));
@@ -687,7 +687,7 @@ int usb_serial_probe(struct usb_interface *interface,
 #endif
 
        /* found all that we need */
-       dev_info(&interface->dev, "%s converter detected\n", type->name);
+       dev_info(&interface->dev, "%s converter detected\n", type->description);
 
 #ifdef CONFIG_USB_SERIAL_GENERIC
        if (type == &usb_serial_generic_device) {
@@ -1088,16 +1088,19 @@ int usb_serial_register(struct usb_serial_driver *driver)
 
        fixup_generic(driver);
 
+       if (!driver->description)
+               driver->description = driver->driver.name;
+
        /* Add this device to our list of devices */
        list_add(&driver->driver_list, &usb_serial_driver_list);
 
        retval = usb_serial_bus_register(driver);
        if (retval) {
-               err("problem %d when registering driver %s", retval, driver->name);
+               err("problem %d when registering driver %s", retval, driver->description);
                list_del(&driver->driver_list);
        }
        else
-               info("USB Serial support registered for %s", driver->name);
+               info("USB Serial support registered for %s", driver->description);
 
        return retval;
 }
@@ -1105,7 +1108,7 @@ int usb_serial_register(struct usb_serial_driver *driver)
 
 void usb_serial_deregister(struct usb_serial_driver *device)
 {
-       info("USB Serial deregistering driver %s", device->name);
+       info("USB Serial deregistering driver %s", device->description);
        list_del(&device->driver_list);
        usb_serial_bus_deregister(device);
 }
index 1cedc19995089d50cacbc8ac2626b388e6351e98..238a5a871ed665cd9ecd6a2f415c2314d9ead4e6 100644 (file)
@@ -149,11 +149,8 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
 
 /**
  * usb_serial_driver - describes a usb serial driver
- * @name: pointer to a string that describes this driver.  This string used
+ * @description: pointer to a string that describes this driver.  This string used
  *     in the syslog messages when a device is inserted or removed.
- * @short_name: a pointer to a string that describes this driver in
- *     KOBJ_NAME_LEN characters or less.  This is used for the sysfs interface
- *     to describe the driver.
  * @id_table: pointer to a list of usb_device_id structures that define all
  *     of the devices this structure can support.
  * @num_interrupt_in: the number of interrupt in endpoints this device will
@@ -187,11 +184,12 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
  * called, the generic serial function will be used instead.
  *
  * The driver.owner field should be set to the module owner of this driver.
- *
+ * The driver.name field should be set to the name of this driver (remember
+ * it will show up in sysfs, so it needs to be short and to the point.
+ * Useing the module name is a good idea.)
  */
 struct usb_serial_driver {
-       char    *name;
-       char    *short_name;
+       const char *description;
        const struct usb_device_id *id_table;
        char    num_interrupt_in;
        char    num_interrupt_out;
index 39ad0cab86357bcebdae3b3bf57ab0370ac00fe4..baa2acb28bd8da030fe8d4e63b233c50190365e6 100644 (file)
@@ -185,9 +185,9 @@ static struct usb_driver visor_driver = {
 static struct usb_serial_driver handspring_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "visor",
        },
-       .name =                 "Handspring Visor / Palm OS",
-       .short_name =           "visor",
+       .description =          "Handspring Visor / Palm OS",
        .id_table =             id_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          2,
@@ -215,9 +215,9 @@ static struct usb_serial_driver handspring_device = {
 static struct usb_serial_driver clie_5_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "clie_5",
        },
-       .name =                 "Sony Clie 5.0",
-       .short_name =           "clie_5",
+       .description =          "Sony Clie 5.0",
        .id_table =             clie_id_5_table,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          2,
@@ -245,9 +245,9 @@ static struct usb_serial_driver clie_5_device = {
 static struct usb_serial_driver clie_3_5_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "clie_3.5",
        },
-       .name =                 "Sony Clie 3.5",
-       .short_name =           "clie_3.5",
+       .description =          "Sony Clie 3.5",
        .id_table =             clie_id_3_5_table,
        .num_interrupt_in =     0,
        .num_bulk_in =          1,
@@ -659,7 +659,7 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
                                        break;
                        }
                        dev_info(dev, "%s: port %d, is for %s use\n",
-                               serial->type->name,
+                               serial->type->description,
                                connection_info->connections[i].port, string);
                }
        }
@@ -668,11 +668,11 @@ static int palm_os_3_probe (struct usb_serial *serial, const struct usb_device_i
        */
        if (num_ports == 0 || num_ports > 2) {
                dev_warn (dev, "%s: No valid connect info available\n",
-                       serial->type->name);
+                       serial->type->description);
                num_ports = 2;
        }
   
-       dev_info(dev, "%s: Number of ports: %d\n", serial->type->name,
+       dev_info(dev, "%s: Number of ports: %d\n", serial->type->description,
                num_ports);
 
        /*
index fb95a34a1cf72e6210802ceb0d4af27bc7cf7258..18c3183be769d3bea41cafce1e7b226bb29325b9 100644 (file)
@@ -159,9 +159,9 @@ static void whiteheat_write_callback        (struct urb *urb, struct pt_regs *regs);
 static struct usb_serial_driver whiteheat_fake_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "whiteheatnofirm",
        },
-       .name =                 "Connect Tech - WhiteHEAT - (prerenumeration)",
-       .short_name =           "whiteheatnofirm",
+       .description =          "Connect Tech - WhiteHEAT - (prerenumeration)",
        .id_table =             id_table_prerenumeration,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
@@ -174,9 +174,9 @@ static struct usb_serial_driver whiteheat_fake_device = {
 static struct usb_serial_driver whiteheat_device = {
        .driver = {
                .owner =        THIS_MODULE,
+               .name =         "whiteheat",
        },
-       .name =                 "Connect Tech - WhiteHEAT",
-       .short_name =           "whiteheat",
+       .description =          "Connect Tech - WhiteHEAT",
        .id_table =             id_table_std,
        .num_interrupt_in =     NUM_DONT_CARE,
        .num_bulk_in =          NUM_DONT_CARE,
@@ -386,10 +386,10 @@ static int whiteheat_attach (struct usb_serial *serial)
        usb_clear_halt(serial->dev, pipe);
        ret = usb_bulk_msg (serial->dev, pipe, command, 2, &alen, COMMAND_TIMEOUT_MS);
        if (ret) {
-               err("%s: Couldn't send command [%d]", serial->type->name, ret);
+               err("%s: Couldn't send command [%d]", serial->type->description, ret);
                goto no_firmware;
        } else if (alen != sizeof(command)) {
-               err("%s: Send command incomplete [%d]", serial->type->name, alen);
+               err("%s: Send command incomplete [%d]", serial->type->description, alen);
                goto no_firmware;
        }
 
@@ -398,19 +398,19 @@ static int whiteheat_attach (struct usb_serial *serial)
        usb_clear_halt(serial->dev, pipe);
        ret = usb_bulk_msg (serial->dev, pipe, result, sizeof(*hw_info) + 1, &alen, COMMAND_TIMEOUT_MS);
        if (ret) {
-               err("%s: Couldn't get results [%d]", serial->type->name, ret);
+               err("%s: Couldn't get results [%d]", serial->type->description, ret);
                goto no_firmware;
        } else if (alen != sizeof(result)) {
-               err("%s: Get results incomplete [%d]", serial->type->name, alen);
+               err("%s: Get results incomplete [%d]", serial->type->description, alen);
                goto no_firmware;
        } else if (result[0] != command[0]) {
-               err("%s: Command failed [%d]", serial->type->name, result[0]);
+               err("%s: Command failed [%d]", serial->type->description, result[0]);
                goto no_firmware;
        }
 
        hw_info = (struct whiteheat_hw_info *)&result[1];
 
-       info("%s: Driver %s: Firmware v%d.%02d", serial->type->name,
+       info("%s: Driver %s: Firmware v%d.%02d", serial->type->description,
             DRIVER_VERSION, hw_info->sw_major_rev, hw_info->sw_minor_rev);
 
        for (i = 0; i < serial->num_ports; i++) {
@@ -418,7 +418,7 @@ static int whiteheat_attach (struct usb_serial *serial)
 
                info = (struct whiteheat_private *)kmalloc(sizeof(struct whiteheat_private), GFP_KERNEL);
                if (info == NULL) {
-                       err("%s: Out of memory for port structures\n", serial->type->name);
+                       err("%s: Out of memory for port structures\n", serial->type->description);
                        goto no_private;
                }
 
@@ -488,7 +488,7 @@ static int whiteheat_attach (struct usb_serial *serial)
 
        command_info = (struct whiteheat_command_private *)kmalloc(sizeof(struct whiteheat_command_private), GFP_KERNEL);
        if (command_info == NULL) {
-               err("%s: Out of memory for port structures\n", serial->type->name);
+               err("%s: Out of memory for port structures\n", serial->type->description);
                goto no_command_private;
        }
 
@@ -505,9 +505,9 @@ static int whiteheat_attach (struct usb_serial *serial)
 
 no_firmware:
        /* Firmware likely not running */
-       err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->name);
-       err("%s: If the firmware is not running (status led not blinking)\n", serial->type->name);
-       err("%s: please contact support@connecttech.com\n", serial->type->name);
+       err("%s: Unable to retrieve firmware version, try replugging\n", serial->type->description);
+       err("%s: If the firmware is not running (status led not blinking)\n", serial->type->description);
+       err("%s: please contact support@connecttech.com\n", serial->type->description);
        return -ENODEV;
 
 no_command_private: