ChangeSet 1.883.3.9, 2002/12/16 18:13:47-08:00, greg@kroah.com [PATCH] USB: usbserial: Add a short_name field to work better with sysfs. This cleans up the bus/usb-serial/drivers/ directory diff -Nru a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c --- a/drivers/usb/serial/belkin_sa.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/belkin_sa.c Wed Dec 18 00:34:46 2002 @@ -126,6 +126,7 @@ static struct usb_serial_device_type belkin_device = { .owner = THIS_MODULE, .name = "Belkin / Peracom / GoHubs USB Serial Adapter", + .short_name = "belkin", .id_table = id_table_combined, .num_interrupt_in = 1, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/bus.c b/drivers/usb/serial/bus.c --- a/drivers/usb/serial/bus.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/bus.c Wed Dec 18 00:34:46 2002 @@ -121,7 +121,10 @@ { int retval; - device->driver.name = (char *)device->name; + if (device->short_name) + device->driver.name = (char *)device->short_name; + else + device->driver.name = (char *)device->name; device->driver.bus = &usb_serial_bus_type; device->driver.probe = usb_serial_device_probe; device->driver.remove = usb_serial_device_remove; diff -Nru a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c --- a/drivers/usb/serial/cyberjack.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/cyberjack.c Wed Dec 18 00:34:46 2002 @@ -83,6 +83,7 @@ static struct usb_serial_device_type cyberjack_device = { .owner = THIS_MODULE, .name = "Reiner SCT Cyberjack USB card reader", + .short_name = "cyberjack", .id_table = id_table, .num_interrupt_in = 1, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c --- a/drivers/usb/serial/generic.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/generic.c Wed Dec 18 00:34:46 2002 @@ -43,6 +43,7 @@ struct usb_serial_device_type usb_serial_generic_device = { .owner = THIS_MODULE, .name = "Generic", + .short_name = "generic", .id_table = generic_device_ids, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, diff -Nru a/drivers/usb/serial/io_tables.h b/drivers/usb/serial/io_tables.h --- a/drivers/usb/serial/io_tables.h Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/io_tables.h Wed Dec 18 00:34:46 2002 @@ -100,6 +100,7 @@ static struct usb_serial_device_type edgeport_1port_device = { .owner = THIS_MODULE, .name = "Edgeport 1 port adapter", + .short_name = "edgeport_1", .id_table = edgeport_1port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -122,6 +123,7 @@ static struct usb_serial_device_type edgeport_2port_device = { .owner = THIS_MODULE, .name = "Edgeport 2 port adapter", + .short_name = "edgeport_2", .id_table = edgeport_2port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -144,6 +146,7 @@ static struct usb_serial_device_type edgeport_4port_device = { .owner = THIS_MODULE, .name = "Edgeport 4 port adapter", + .short_name = "edgeport_4", .id_table = edgeport_4port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -166,6 +169,7 @@ static struct usb_serial_device_type edgeport_8port_device = { .owner = THIS_MODULE, .name = "Edgeport 8 port adapter", + .short_name = "edgeport_8", .id_table = edgeport_8port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c --- a/drivers/usb/serial/io_ti.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/io_ti.c Wed Dec 18 00:34:46 2002 @@ -2635,6 +2635,7 @@ static struct usb_serial_device_type edgeport_1port_device = { .owner = THIS_MODULE, .name = "Edgeport TI 1 port adapter", + .short_name = "edgeport_ti_1", .id_table = edgeport_1port_id_table, .num_interrupt_in = 1, .num_bulk_in = 1, @@ -2657,6 +2658,7 @@ static struct usb_serial_device_type edgeport_2port_device = { .owner = THIS_MODULE, .name = "Edgeport TI 2 port adapter", + .short_name = "edgeport_ti_2", .id_table = edgeport_2port_id_table, .num_interrupt_in = 1, .num_bulk_in = 2, diff -Nru a/drivers/usb/serial/keyspan.h b/drivers/usb/serial/keyspan.h --- a/drivers/usb/serial/keyspan.h Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/keyspan.h Wed Dec 18 00:34:46 2002 @@ -481,6 +481,7 @@ static struct usb_serial_device_type keyspan_pre_device = { .owner = THIS_MODULE, .name = "Keyspan - (without firmware)", + .short_name = "keyspan_no_firm", .id_table = keyspan_pre_ids, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, @@ -492,6 +493,7 @@ static struct usb_serial_device_type keyspan_1port_device = { .owner = THIS_MODULE, .name = "Keyspan 1 port adapter", + .short_name = "keyspan_1", .id_table = keyspan_1port_ids, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = 3, @@ -514,6 +516,7 @@ static struct usb_serial_device_type keyspan_2port_device = { .owner = THIS_MODULE, .name = "Keyspan 2 port adapter", + .short_name = "keyspan_2", .id_table = keyspan_2port_ids, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, @@ -536,6 +539,7 @@ static struct usb_serial_device_type keyspan_4port_device = { .owner = THIS_MODULE, .name = "Keyspan 4 port adapter", + .short_name = "keyspan_4", .id_table = keyspan_4port_ids, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = 5, diff -Nru a/drivers/usb/serial/keyspan_pda.c b/drivers/usb/serial/keyspan_pda.c --- a/drivers/usb/serial/keyspan_pda.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/keyspan_pda.c Wed Dec 18 00:34:46 2002 @@ -827,6 +827,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = { .owner = THIS_MODULE, .name = "Keyspan PDA - (prerenumeration)", + .short_name = "kyspn_pda_nofirm", .id_table = id_table_fake, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, @@ -840,6 +841,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = { .owner = THIS_MODULE, .name = "Xircom / Entregra PGS - (prerenumeration)", + .short_name = "xircom_nofirm", .id_table = id_table_fake_xircom, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, @@ -852,6 +854,7 @@ static struct usb_serial_device_type keyspan_pda_device = { .owner = THIS_MODULE, .name = "Keyspan PDA", + .short_name = "keyspan_pda", .id_table = id_table_std, .num_interrupt_in = 1, .num_bulk_in = 0, diff -Nru a/drivers/usb/serial/kl5kusb105.c b/drivers/usb/serial/kl5kusb105.c --- a/drivers/usb/serial/kl5kusb105.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/kl5kusb105.c Wed Dec 18 00:34:46 2002 @@ -127,6 +127,7 @@ static struct usb_serial_device_type kl5kusb105d_device = { .owner = THIS_MODULE, .name = "KL5KUSB105D / PalmConnect", + .short_name = "kl5kusb105d", .id_table = id_table, .num_interrupt_in = 1, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c --- a/drivers/usb/serial/mct_u232.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/mct_u232.c Wed Dec 18 00:34:46 2002 @@ -149,6 +149,7 @@ static struct usb_serial_device_type mct_u232_device = { .owner = THIS_MODULE, .name = "Magic Control Technology USB-RS232", + .short_name = "mct_u232", .id_table = id_table_combined, .num_interrupt_in = 2, .num_bulk_in = 0, diff -Nru a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c --- a/drivers/usb/serial/omninet.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/omninet.c Wed Dec 18 00:34:46 2002 @@ -94,6 +94,7 @@ static struct usb_serial_device_type zyxel_omninet_device = { .owner = THIS_MODULE, .name = "ZyXEL - omni.net lcd plus usb", + .short_name = "omninet", .id_table = id_table, .num_interrupt_in = 1, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/usb-serial.h b/drivers/usb/serial/usb-serial.h --- a/drivers/usb/serial/usb-serial.h Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/usb-serial.h Wed Dec 18 00:34:46 2002 @@ -168,6 +168,9 @@ * @owner: pointer to the module that owns this device. * @name: pointer to a string that describes this device. This string used * in the syslog messages when a device is inserted or removed. + * @short_name: a pointer to a string that describes this device 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 @@ -201,6 +204,7 @@ struct usb_serial_device_type { struct module *owner; char *name; + char *short_name; const struct usb_device_id *id_table; char num_interrupt_in; char num_bulk_in; diff -Nru a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c --- a/drivers/usb/serial/visor.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/visor.c Wed Dec 18 00:34:46 2002 @@ -236,6 +236,7 @@ static struct usb_serial_device_type handspring_device = { .owner = THIS_MODULE, .name = "Handspring Visor / Treo / Palm 4.0 / Clié 4.x", + .short_name = "visor", .id_table = id_table, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = 2, @@ -262,6 +263,7 @@ static struct usb_serial_device_type clie_3_5_device = { .owner = THIS_MODULE, .name = "Sony Clié 3.5", + .short_name = "clie_3.5", .id_table = clie_id_3_5_table, .num_interrupt_in = 0, .num_bulk_in = 1, diff -Nru a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c --- a/drivers/usb/serial/whiteheat.c Wed Dec 18 00:34:46 2002 +++ b/drivers/usb/serial/whiteheat.c Wed Dec 18 00:34:46 2002 @@ -156,6 +156,7 @@ static struct usb_serial_device_type whiteheat_fake_device = { .owner = THIS_MODULE, .name = "Connect Tech - WhiteHEAT - (prerenumeration)", + .short_name = "whiteheatnofirm", .id_table = id_table_prerenumeration, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE, @@ -168,6 +169,7 @@ static struct usb_serial_device_type whiteheat_device = { .owner = THIS_MODULE, .name = "Connect Tech - WhiteHEAT", + .short_name = "whiteheat", .id_table = id_table_std, .num_interrupt_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,