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 = {
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,
......
......@@ -121,7 +121,10 @@ int usb_serial_bus_register(struct usb_serial_device_type *device)
{
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;
......
......@@ -83,6 +83,7 @@ static struct usb_driver cyberjack_driver = {
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,
......
......@@ -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 = {
.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,
......
......@@ -100,6 +100,7 @@ MODULE_DEVICE_TABLE (usb, id_table_combined);
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_1port_device = {
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_2port_device = {
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_4port_device = {
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,
......
......@@ -2635,6 +2635,7 @@ static void edge_shutdown (struct usb_serial *serial)
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_1port_device = {
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,
......
......@@ -481,6 +481,7 @@ static struct usb_device_id keyspan_4port_ids[] = {
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_pre_device = {
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_1port_device = {
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_2port_device = {
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,
......
......@@ -827,6 +827,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
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 keyspan_pda_fake_device = {
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 xircom_pgs_fake_device = {
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,
......
......@@ -127,6 +127,7 @@ static struct usb_driver kl5kusb105d_driver = {
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,
......
......@@ -149,6 +149,7 @@ static struct usb_driver mct_u232_driver = {
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,
......
......@@ -94,6 +94,7 @@ static struct usb_driver omninet_driver = {
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,
......
......@@ -168,6 +168,9 @@ struct usb_serial {
* @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 {
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;
......
......@@ -236,6 +236,7 @@ static struct usb_driver visor_driver = {
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 handspring_device = {
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,
......
......@@ -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 = {
.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_fake_device = {
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,
......
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