Commit e5ccffb2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB: usbserial: Add a short_name field to work better with sysfs.

This cleans up the bus/usb-serial/drivers/ directory
parent 12bf6ce9
...@@ -126,6 +126,7 @@ static struct usb_driver belkin_driver = { ...@@ -126,6 +126,7 @@ static struct usb_driver belkin_driver = {
static struct usb_serial_device_type belkin_device = { static struct usb_serial_device_type belkin_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Belkin / Peracom / GoHubs USB Serial Adapter", .name = "Belkin / Peracom / GoHubs USB Serial Adapter",
.short_name = "belkin",
.id_table = id_table_combined, .id_table = id_table_combined,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -121,6 +121,9 @@ int usb_serial_bus_register(struct usb_serial_device_type *device) ...@@ -121,6 +121,9 @@ int usb_serial_bus_register(struct usb_serial_device_type *device)
{ {
int retval; int retval;
if (device->short_name)
device->driver.name = (char *)device->short_name;
else
device->driver.name = (char *)device->name; device->driver.name = (char *)device->name;
device->driver.bus = &usb_serial_bus_type; device->driver.bus = &usb_serial_bus_type;
device->driver.probe = usb_serial_device_probe; device->driver.probe = usb_serial_device_probe;
......
...@@ -83,6 +83,7 @@ static struct usb_driver cyberjack_driver = { ...@@ -83,6 +83,7 @@ static struct usb_driver cyberjack_driver = {
static struct usb_serial_device_type cyberjack_device = { static struct usb_serial_device_type cyberjack_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Reiner SCT Cyberjack USB card reader", .name = "Reiner SCT Cyberjack USB card reader",
.short_name = "cyberjack",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -43,6 +43,7 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ ...@@ -43,6 +43,7 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
struct usb_serial_device_type usb_serial_generic_device = { struct usb_serial_device_type usb_serial_generic_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Generic", .name = "Generic",
.short_name = "generic",
.id_table = generic_device_ids, .id_table = generic_device_ids,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
......
...@@ -100,6 +100,7 @@ MODULE_DEVICE_TABLE (usb, id_table_combined); ...@@ -100,6 +100,7 @@ MODULE_DEVICE_TABLE (usb, id_table_combined);
static struct usb_serial_device_type edgeport_1port_device = { static struct usb_serial_device_type edgeport_1port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 1 port adapter", .name = "Edgeport 1 port adapter",
.short_name = "edgeport_1",
.id_table = edgeport_1port_id_table, .id_table = edgeport_1port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
...@@ -122,6 +123,7 @@ static struct usb_serial_device_type edgeport_1port_device = { ...@@ -122,6 +123,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
static struct usb_serial_device_type edgeport_2port_device = { static struct usb_serial_device_type edgeport_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 2 port adapter", .name = "Edgeport 2 port adapter",
.short_name = "edgeport_2",
.id_table = edgeport_2port_id_table, .id_table = edgeport_2port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
...@@ -144,6 +146,7 @@ static struct usb_serial_device_type edgeport_2port_device = { ...@@ -144,6 +146,7 @@ static struct usb_serial_device_type edgeport_2port_device = {
static struct usb_serial_device_type edgeport_4port_device = { static struct usb_serial_device_type edgeport_4port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 4 port adapter", .name = "Edgeport 4 port adapter",
.short_name = "edgeport_4",
.id_table = edgeport_4port_id_table, .id_table = edgeport_4port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
...@@ -166,6 +169,7 @@ static struct usb_serial_device_type edgeport_4port_device = { ...@@ -166,6 +169,7 @@ static struct usb_serial_device_type edgeport_4port_device = {
static struct usb_serial_device_type edgeport_8port_device = { static struct usb_serial_device_type edgeport_8port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 8 port adapter", .name = "Edgeport 8 port adapter",
.short_name = "edgeport_8",
.id_table = edgeport_8port_id_table, .id_table = edgeport_8port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -2635,6 +2635,7 @@ static void edge_shutdown (struct usb_serial *serial) ...@@ -2635,6 +2635,7 @@ static void edge_shutdown (struct usb_serial *serial)
static struct usb_serial_device_type edgeport_1port_device = { static struct usb_serial_device_type edgeport_1port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport TI 1 port adapter", .name = "Edgeport TI 1 port adapter",
.short_name = "edgeport_ti_1",
.id_table = edgeport_1port_id_table, .id_table = edgeport_1port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
...@@ -2657,6 +2658,7 @@ static struct usb_serial_device_type edgeport_1port_device = { ...@@ -2657,6 +2658,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
static struct usb_serial_device_type edgeport_2port_device = { static struct usb_serial_device_type edgeport_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport TI 2 port adapter", .name = "Edgeport TI 2 port adapter",
.short_name = "edgeport_ti_2",
.id_table = edgeport_2port_id_table, .id_table = edgeport_2port_id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 2, .num_bulk_in = 2,
......
...@@ -481,6 +481,7 @@ static struct usb_device_id keyspan_4port_ids[] = { ...@@ -481,6 +481,7 @@ static struct usb_device_id keyspan_4port_ids[] = {
static struct usb_serial_device_type keyspan_pre_device = { static struct usb_serial_device_type keyspan_pre_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan - (without firmware)", .name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm",
.id_table = keyspan_pre_ids, .id_table = keyspan_pre_ids,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
...@@ -492,6 +493,7 @@ static struct usb_serial_device_type keyspan_pre_device = { ...@@ -492,6 +493,7 @@ static struct usb_serial_device_type keyspan_pre_device = {
static struct usb_serial_device_type keyspan_1port_device = { static struct usb_serial_device_type keyspan_1port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 1 port adapter", .name = "Keyspan 1 port adapter",
.short_name = "keyspan_1",
.id_table = keyspan_1port_ids, .id_table = keyspan_1port_ids,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 3, .num_bulk_in = 3,
...@@ -514,6 +516,7 @@ static struct usb_serial_device_type keyspan_1port_device = { ...@@ -514,6 +516,7 @@ static struct usb_serial_device_type keyspan_1port_device = {
static struct usb_serial_device_type keyspan_2port_device = { static struct usb_serial_device_type keyspan_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 2 port adapter", .name = "Keyspan 2 port adapter",
.short_name = "keyspan_2",
.id_table = keyspan_2port_ids, .id_table = keyspan_2port_ids,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
...@@ -536,6 +539,7 @@ static struct usb_serial_device_type keyspan_2port_device = { ...@@ -536,6 +539,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
static struct usb_serial_device_type keyspan_4port_device = { static struct usb_serial_device_type keyspan_4port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 4 port adapter", .name = "Keyspan 4 port adapter",
.short_name = "keyspan_4",
.id_table = keyspan_4port_ids, .id_table = keyspan_4port_ids,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 5, .num_bulk_in = 5,
......
...@@ -827,6 +827,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial) ...@@ -827,6 +827,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
static struct usb_serial_device_type keyspan_pda_fake_device = { static struct usb_serial_device_type keyspan_pda_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan PDA - (prerenumeration)", .name = "Keyspan PDA - (prerenumeration)",
.short_name = "kyspn_pda_nofirm",
.id_table = id_table_fake, .id_table = id_table_fake,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
...@@ -840,6 +841,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = { ...@@ -840,6 +841,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = {
static struct usb_serial_device_type xircom_pgs_fake_device = { static struct usb_serial_device_type xircom_pgs_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Xircom / Entregra PGS - (prerenumeration)", .name = "Xircom / Entregra PGS - (prerenumeration)",
.short_name = "xircom_nofirm",
.id_table = id_table_fake_xircom, .id_table = id_table_fake_xircom,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
...@@ -852,6 +854,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = { ...@@ -852,6 +854,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = {
static struct usb_serial_device_type keyspan_pda_device = { static struct usb_serial_device_type keyspan_pda_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan PDA", .name = "Keyspan PDA",
.short_name = "keyspan_pda",
.id_table = id_table_std, .id_table = id_table_std,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 0, .num_bulk_in = 0,
......
...@@ -127,6 +127,7 @@ static struct usb_driver kl5kusb105d_driver = { ...@@ -127,6 +127,7 @@ static struct usb_driver kl5kusb105d_driver = {
static struct usb_serial_device_type kl5kusb105d_device = { static struct usb_serial_device_type kl5kusb105d_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "KL5KUSB105D / PalmConnect", .name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -149,6 +149,7 @@ static struct usb_driver mct_u232_driver = { ...@@ -149,6 +149,7 @@ static struct usb_driver mct_u232_driver = {
static struct usb_serial_device_type mct_u232_device = { static struct usb_serial_device_type mct_u232_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Magic Control Technology USB-RS232", .name = "Magic Control Technology USB-RS232",
.short_name = "mct_u232",
.id_table = id_table_combined, .id_table = id_table_combined,
.num_interrupt_in = 2, .num_interrupt_in = 2,
.num_bulk_in = 0, .num_bulk_in = 0,
......
...@@ -94,6 +94,7 @@ static struct usb_driver omninet_driver = { ...@@ -94,6 +94,7 @@ static struct usb_driver omninet_driver = {
static struct usb_serial_device_type zyxel_omninet_device = { static struct usb_serial_device_type zyxel_omninet_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "ZyXEL - omni.net lcd plus usb", .name = "ZyXEL - omni.net lcd plus usb",
.short_name = "omninet",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -168,6 +168,9 @@ struct usb_serial { ...@@ -168,6 +168,9 @@ struct usb_serial {
* @owner: pointer to the module that owns this device. * @owner: pointer to the module that owns this device.
* @name: pointer to a string that describes this device. This string used * @name: pointer to a string that describes this device. This string used
* in the syslog messages when a device is inserted or removed. * 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 * @id_table: pointer to a list of usb_device_id structures that define all
* of the devices this structure can support. * of the devices this structure can support.
* @num_interrupt_in: the number of interrupt in endpoints this device will * @num_interrupt_in: the number of interrupt in endpoints this device will
...@@ -201,6 +204,7 @@ struct usb_serial { ...@@ -201,6 +204,7 @@ struct usb_serial {
struct usb_serial_device_type { struct usb_serial_device_type {
struct module *owner; struct module *owner;
char *name; char *name;
char *short_name;
const struct usb_device_id *id_table; const struct usb_device_id *id_table;
char num_interrupt_in; char num_interrupt_in;
char num_bulk_in; char num_bulk_in;
......
...@@ -236,6 +236,7 @@ static struct usb_driver visor_driver = { ...@@ -236,6 +236,7 @@ static struct usb_driver visor_driver = {
static struct usb_serial_device_type handspring_device = { static struct usb_serial_device_type handspring_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Handspring Visor / Treo / Palm 4.0 / Clié 4.x", .name = "Handspring Visor / Treo / Palm 4.0 / Clié 4.x",
.short_name = "visor",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = 2, .num_bulk_in = 2,
...@@ -262,6 +263,7 @@ static struct usb_serial_device_type handspring_device = { ...@@ -262,6 +263,7 @@ static struct usb_serial_device_type handspring_device = {
static struct usb_serial_device_type clie_3_5_device = { static struct usb_serial_device_type clie_3_5_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Sony Clié 3.5", .name = "Sony Clié 3.5",
.short_name = "clie_3.5",
.id_table = clie_id_3_5_table, .id_table = clie_id_3_5_table,
.num_interrupt_in = 0, .num_interrupt_in = 0,
.num_bulk_in = 1, .num_bulk_in = 1,
......
...@@ -156,6 +156,7 @@ static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs); ...@@ -156,6 +156,7 @@ static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs);
static struct usb_serial_device_type whiteheat_fake_device = { static struct usb_serial_device_type whiteheat_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT - (prerenumeration)", .name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm",
.id_table = id_table_prerenumeration, .id_table = id_table_prerenumeration,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
...@@ -168,6 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = { ...@@ -168,6 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = {
static struct usb_serial_device_type whiteheat_device = { static struct usb_serial_device_type whiteheat_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT", .name = "Connect Tech - WhiteHEAT",
.short_name = "whiteheat",
.id_table = id_table_std, .id_table = id_table_std,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
.num_bulk_in = NUM_DONT_CARE, .num_bulk_in = NUM_DONT_CARE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment