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

[PATCH] USB Serial: rename usb_serial_device_type to usb_serial_driver

I'm tired of trying to explain why a "device_type" is really a driver.
This better describes exactly what this structure is.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a6c82600
...@@ -30,7 +30,7 @@ static struct usb_driver airprime_driver = { ...@@ -30,7 +30,7 @@ static struct usb_driver airprime_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type airprime_device = { static struct usb_serial_driver airprime_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "airprime", .name = "airprime",
.id_table = id_table, .id_table = id_table,
......
...@@ -121,7 +121,7 @@ static struct usb_driver belkin_driver = { ...@@ -121,7 +121,7 @@ static struct usb_driver belkin_driver = {
}; };
/* All of the device info needed for the serial converters */ /* All of the device info needed for the serial converters */
static struct usb_serial_device_type belkin_device = { static struct usb_serial_driver 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", .short_name = "belkin",
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
static int usb_serial_device_match (struct device *dev, struct device_driver *drv) static int usb_serial_device_match (struct device *dev, struct device_driver *drv)
{ {
struct usb_serial_device_type *driver; struct usb_serial_driver *driver;
const struct usb_serial_port *port; const struct usb_serial_port *port;
/* /*
...@@ -44,7 +44,7 @@ struct bus_type usb_serial_bus_type = { ...@@ -44,7 +44,7 @@ struct bus_type usb_serial_bus_type = {
static int usb_serial_device_probe (struct device *dev) static int usb_serial_device_probe (struct device *dev)
{ {
struct usb_serial_device_type *driver; struct usb_serial_driver *driver;
struct usb_serial_port *port; struct usb_serial_port *port;
int retval = 0; int retval = 0;
int minor; int minor;
...@@ -80,7 +80,7 @@ static int usb_serial_device_probe (struct device *dev) ...@@ -80,7 +80,7 @@ static int usb_serial_device_probe (struct device *dev)
static int usb_serial_device_remove (struct device *dev) static int usb_serial_device_remove (struct device *dev)
{ {
struct usb_serial_device_type *driver; struct usb_serial_driver *driver;
struct usb_serial_port *port; struct usb_serial_port *port;
int retval = 0; int retval = 0;
int minor; int minor;
...@@ -109,26 +109,26 @@ static int usb_serial_device_remove (struct device *dev) ...@@ -109,26 +109,26 @@ static int usb_serial_device_remove (struct device *dev)
return retval; return retval;
} }
int usb_serial_bus_register(struct usb_serial_device_type *device) int usb_serial_bus_register(struct usb_serial_driver *driver)
{ {
int retval; int retval;
if (device->short_name) if (driver->short_name)
device->driver.name = (char *)device->short_name; driver->driver.name = (char *)driver->short_name;
else else
device->driver.name = (char *)device->name; driver->driver.name = (char *)driver->name;
device->driver.bus = &usb_serial_bus_type; driver->driver.bus = &usb_serial_bus_type;
device->driver.probe = usb_serial_device_probe; driver->driver.probe = usb_serial_device_probe;
device->driver.remove = usb_serial_device_remove; driver->driver.remove = usb_serial_device_remove;
device->driver.owner = device->owner; driver->driver.owner = driver->owner;
retval = driver_register(&device->driver); retval = driver_register(&driver->driver);
return retval; return retval;
} }
void usb_serial_bus_deregister(struct usb_serial_device_type *device) void usb_serial_bus_deregister(struct usb_serial_driver *driver)
{ {
driver_unregister (&device->driver); driver_unregister(&driver->driver);
} }
...@@ -73,7 +73,7 @@ static struct usb_driver cp2101_driver = { ...@@ -73,7 +73,7 @@ static struct usb_driver cp2101_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type cp2101_device = { static struct usb_serial_driver cp2101_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "CP2101", .name = "CP2101",
.id_table = id_table, .id_table = id_table,
......
...@@ -83,7 +83,7 @@ static struct usb_driver cyberjack_driver = { ...@@ -83,7 +83,7 @@ static struct usb_driver cyberjack_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type cyberjack_device = { static struct usb_serial_driver 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", .short_name = "cyberjack",
......
...@@ -176,7 +176,7 @@ static unsigned int cypress_buf_put(struct cypress_buf *cb, const char *buf, u ...@@ -176,7 +176,7 @@ static unsigned int cypress_buf_put(struct cypress_buf *cb, const char *buf, u
static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigned int count); static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigned int count);
static struct usb_serial_device_type cypress_earthmate_device = { static struct usb_serial_driver cypress_earthmate_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "DeLorme Earthmate USB", .name = "DeLorme Earthmate USB",
.short_name = "earthmate", .short_name = "earthmate",
...@@ -203,7 +203,7 @@ static struct usb_serial_device_type cypress_earthmate_device = { ...@@ -203,7 +203,7 @@ static struct usb_serial_device_type cypress_earthmate_device = {
.write_int_callback = cypress_write_int_callback, .write_int_callback = cypress_write_int_callback,
}; };
static struct usb_serial_device_type cypress_hidcom_device = { static struct usb_serial_driver cypress_hidcom_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "HID->COM RS232 Adapter", .name = "HID->COM RS232 Adapter",
.short_name = "cyphidcom", .short_name = "cyphidcom",
......
...@@ -503,7 +503,7 @@ static struct usb_driver digi_driver = { ...@@ -503,7 +503,7 @@ static struct usb_driver digi_driver = {
/* device info needed for the Digi serial converter */ /* device info needed for the Digi serial converter */
static struct usb_serial_device_type digi_acceleport_2_device = { static struct usb_serial_driver digi_acceleport_2_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Digi 2 port USB adapter", .name = "Digi 2 port USB adapter",
.short_name = "digi_2", .short_name = "digi_2",
...@@ -530,7 +530,7 @@ static struct usb_serial_device_type digi_acceleport_2_device = { ...@@ -530,7 +530,7 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
.shutdown = digi_shutdown, .shutdown = digi_shutdown,
}; };
static struct usb_serial_device_type digi_acceleport_4_device = { static struct usb_serial_driver digi_acceleport_4_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Digi 4 port USB adapter", .name = "Digi 4 port USB adapter",
.short_name = "digi_4", .short_name = "digi_4",
......
...@@ -112,7 +112,7 @@ static struct usb_driver empeg_driver = { ...@@ -112,7 +112,7 @@ static struct usb_driver empeg_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type empeg_device = { static struct usb_serial_driver empeg_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Empeg", .name = "Empeg",
.id_table = id_table, .id_table = id_table,
......
...@@ -562,7 +562,7 @@ static unsigned short int ftdi_232am_baud_to_divisor (int baud); ...@@ -562,7 +562,7 @@ static unsigned short int ftdi_232am_baud_to_divisor (int baud);
static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base); static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base);
static __u32 ftdi_232bm_baud_to_divisor (int baud); static __u32 ftdi_232bm_baud_to_divisor (int baud);
static struct usb_serial_device_type ftdi_sio_device = { static struct usb_serial_driver ftdi_sio_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "FTDI USB Serial Device", .name = "FTDI USB Serial Device",
.short_name = "ftdi_sio", .short_name = "ftdi_sio",
......
...@@ -1468,13 +1468,8 @@ static void garmin_shutdown (struct usb_serial *serial) ...@@ -1468,13 +1468,8 @@ static void garmin_shutdown (struct usb_serial *serial)
} }
/* All of the device info needed */ /* All of the device info needed */
static struct usb_serial_device_type garmin_device = { static struct usb_serial_driver garmin_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Garmin GPS usb/tty", .name = "Garmin GPS usb/tty",
.short_name = "garmin_gps", .short_name = "garmin_gps",
......
...@@ -36,7 +36,7 @@ MODULE_PARM_DESC(product, "User specified USB idProduct"); ...@@ -36,7 +36,7 @@ MODULE_PARM_DESC(product, "User specified USB idProduct");
static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
/* All of the device info needed for the Generic Serial Converter */ /* All of the device info needed for the Generic Serial Converter */
struct usb_serial_device_type usb_serial_generic_device = { struct usb_serial_driver usb_serial_generic_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Generic", .name = "Generic",
.short_name = "generic", .short_name = "generic",
......
...@@ -44,7 +44,7 @@ static struct usb_driver hp49gp_driver = { ...@@ -44,7 +44,7 @@ static struct usb_driver hp49gp_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type hp49gp_device = { static struct usb_serial_driver hp49gp_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "HP4X", .name = "HP4X",
.id_table = id_table, .id_table = id_table,
......
...@@ -75,7 +75,7 @@ static struct usb_device_id id_table_combined [] = { ...@@ -75,7 +75,7 @@ static struct usb_device_id id_table_combined [] = {
MODULE_DEVICE_TABLE (usb, id_table_combined); MODULE_DEVICE_TABLE (usb, id_table_combined);
static struct usb_serial_device_type edgeport_2port_device = { static struct usb_serial_driver edgeport_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 2 port adapter", .name = "Edgeport 2 port adapter",
.short_name = "edgeport_2", .short_name = "edgeport_2",
...@@ -103,7 +103,7 @@ static struct usb_serial_device_type edgeport_2port_device = { ...@@ -103,7 +103,7 @@ static struct usb_serial_device_type edgeport_2port_device = {
.write_bulk_callback = edge_bulk_out_data_callback, .write_bulk_callback = edge_bulk_out_data_callback,
}; };
static struct usb_serial_device_type edgeport_4port_device = { static struct usb_serial_driver edgeport_4port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 4 port adapter", .name = "Edgeport 4 port adapter",
.short_name = "edgeport_4", .short_name = "edgeport_4",
...@@ -131,7 +131,7 @@ static struct usb_serial_device_type edgeport_4port_device = { ...@@ -131,7 +131,7 @@ static struct usb_serial_device_type edgeport_4port_device = {
.write_bulk_callback = edge_bulk_out_data_callback, .write_bulk_callback = edge_bulk_out_data_callback,
}; };
static struct usb_serial_device_type edgeport_8port_device = { static struct usb_serial_driver edgeport_8port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Edgeport 8 port adapter", .name = "Edgeport 8 port adapter",
.short_name = "edgeport_8", .short_name = "edgeport_8",
......
...@@ -2982,7 +2982,7 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf, ...@@ -2982,7 +2982,7 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf,
} }
static struct usb_serial_device_type edgeport_1port_device = { static struct usb_serial_driver 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", .short_name = "edgeport_ti_1",
...@@ -3010,7 +3010,7 @@ static struct usb_serial_device_type edgeport_1port_device = { ...@@ -3010,7 +3010,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
.write_bulk_callback = edge_bulk_out_callback, .write_bulk_callback = edge_bulk_out_callback,
}; };
static struct usb_serial_device_type edgeport_2port_device = { static struct usb_serial_driver 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", .short_name = "edgeport_ti_2",
......
...@@ -547,7 +547,7 @@ static struct usb_driver ipaq_driver = { ...@@ -547,7 +547,7 @@ static struct usb_driver ipaq_driver = {
/* All of the device info needed for the Compaq iPAQ */ /* All of the device info needed for the Compaq iPAQ */
static struct usb_serial_device_type ipaq_device = { static struct usb_serial_driver ipaq_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "PocketPC PDA", .name = "PocketPC PDA",
.id_table = ipaq_id_table, .id_table = ipaq_id_table,
......
...@@ -443,7 +443,7 @@ static int ipw_disconnect(struct usb_serial_port *port) ...@@ -443,7 +443,7 @@ static int ipw_disconnect(struct usb_serial_port *port)
return 0; return 0;
} }
static struct usb_serial_device_type ipw_device = { static struct usb_serial_driver ipw_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "IPWireless converter", .name = "IPWireless converter",
.short_name = "ipw", .short_name = "ipw",
......
...@@ -133,7 +133,7 @@ static struct usb_driver ir_driver = { ...@@ -133,7 +133,7 @@ static struct usb_driver ir_driver = {
}; };
static struct usb_serial_device_type ir_device = { static struct usb_serial_driver ir_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "IR Dongle", .name = "IR Dongle",
.id_table = id_table, .id_table = id_table,
......
...@@ -570,7 +570,7 @@ static struct usb_device_id keyspan_4port_ids[] = { ...@@ -570,7 +570,7 @@ static struct usb_device_id keyspan_4port_ids[] = {
}; };
/* Structs for the devices, pre and post renumeration. */ /* Structs for the devices, pre and post renumeration. */
static struct usb_serial_device_type keyspan_pre_device = { static struct usb_serial_driver keyspan_pre_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan - (without firmware)", .name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm", .short_name = "keyspan_no_firm",
...@@ -582,7 +582,7 @@ static struct usb_serial_device_type keyspan_pre_device = { ...@@ -582,7 +582,7 @@ static struct usb_serial_device_type keyspan_pre_device = {
.attach = keyspan_fake_startup, .attach = keyspan_fake_startup,
}; };
static struct usb_serial_device_type keyspan_1port_device = { static struct usb_serial_driver keyspan_1port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 1 port adapter", .name = "Keyspan 1 port adapter",
.short_name = "keyspan_1", .short_name = "keyspan_1",
...@@ -607,7 +607,7 @@ static struct usb_serial_device_type keyspan_1port_device = { ...@@ -607,7 +607,7 @@ static struct usb_serial_device_type keyspan_1port_device = {
.shutdown = keyspan_shutdown, .shutdown = keyspan_shutdown,
}; };
static struct usb_serial_device_type keyspan_2port_device = { static struct usb_serial_driver keyspan_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 2 port adapter", .name = "Keyspan 2 port adapter",
.short_name = "keyspan_2", .short_name = "keyspan_2",
...@@ -632,7 +632,7 @@ static struct usb_serial_device_type keyspan_2port_device = { ...@@ -632,7 +632,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
.shutdown = keyspan_shutdown, .shutdown = keyspan_shutdown,
}; };
static struct usb_serial_device_type keyspan_4port_device = { static struct usb_serial_driver keyspan_4port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan 4 port adapter", .name = "Keyspan 4 port adapter",
.short_name = "keyspan_4", .short_name = "keyspan_4",
......
...@@ -783,7 +783,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial) ...@@ -783,7 +783,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
} }
#ifdef KEYSPAN #ifdef KEYSPAN
static struct usb_serial_device_type keyspan_pda_fake_device = { static struct usb_serial_driver keyspan_pda_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan PDA - (prerenumeration)", .name = "Keyspan PDA - (prerenumeration)",
.short_name = "keyspan_pda_pre", .short_name = "keyspan_pda_pre",
...@@ -797,7 +797,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = { ...@@ -797,7 +797,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = {
#endif #endif
#ifdef XIRCOM #ifdef XIRCOM
static struct usb_serial_device_type xircom_pgs_fake_device = { static struct usb_serial_driver xircom_pgs_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Xircom / Entregra PGS - (prerenumeration)", .name = "Xircom / Entregra PGS - (prerenumeration)",
.short_name = "xircom_no_firm", .short_name = "xircom_no_firm",
...@@ -810,7 +810,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = { ...@@ -810,7 +810,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = {
}; };
#endif #endif
static struct usb_serial_device_type keyspan_pda_device = { static struct usb_serial_driver keyspan_pda_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Keyspan PDA", .name = "Keyspan PDA",
.short_name = "keyspan_pda", .short_name = "keyspan_pda",
......
...@@ -123,7 +123,7 @@ static struct usb_driver kl5kusb105d_driver = { ...@@ -123,7 +123,7 @@ static struct usb_driver kl5kusb105d_driver = {
.id_table = id_table, .id_table = id_table,
}; };
static struct usb_serial_device_type kl5kusb105d_device = { static struct usb_serial_driver kl5kusb105d_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "KL5KUSB105D / PalmConnect", .name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d", .short_name = "kl5kusb105d",
......
...@@ -105,7 +105,7 @@ static struct usb_driver kobil_driver = { ...@@ -105,7 +105,7 @@ static struct usb_driver kobil_driver = {
}; };
static struct usb_serial_device_type kobil_device = { static struct usb_serial_driver kobil_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "KOBIL USB smart card terminal", .name = "KOBIL USB smart card terminal",
.id_table = id_table, .id_table = id_table,
......
...@@ -132,7 +132,7 @@ static struct usb_driver mct_u232_driver = { ...@@ -132,7 +132,7 @@ static struct usb_driver mct_u232_driver = {
.id_table = id_table_combined, .id_table = id_table_combined,
}; };
static struct usb_serial_device_type mct_u232_device = { static struct usb_serial_driver mct_u232_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "MCT U232", .name = "MCT U232",
.short_name = "mct_u232", .short_name = "mct_u232",
......
...@@ -88,7 +88,7 @@ static struct usb_driver omninet_driver = { ...@@ -88,7 +88,7 @@ static struct usb_driver omninet_driver = {
}; };
static struct usb_serial_device_type zyxel_omninet_device = { static struct usb_serial_driver 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", .short_name = "omninet",
......
...@@ -105,7 +105,7 @@ static struct usb_driver option_driver = { ...@@ -105,7 +105,7 @@ static struct usb_driver option_driver = {
/* The card has three separate interfaces, wich the serial driver /* The card has three separate interfaces, wich the serial driver
* recognizes separately, thus num_port=1. * recognizes separately, thus num_port=1.
*/ */
static struct usb_serial_device_type option_3port_device = { static struct usb_serial_driver option_3port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Option 3G data card", .name = "Option 3G data card",
.short_name = "option", .short_name = "option",
......
...@@ -175,7 +175,7 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf, ...@@ -175,7 +175,7 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf,
/* All of the device info needed for the PL2303 SIO serial converter */ /* All of the device info needed for the PL2303 SIO serial converter */
static struct usb_serial_device_type pl2303_device = { static struct usb_serial_driver pl2303_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "PL-2303", .name = "PL-2303",
.id_table = id_table, .id_table = id_table,
......
...@@ -397,7 +397,7 @@ static int safe_startup (struct usb_serial *serial) ...@@ -397,7 +397,7 @@ static int safe_startup (struct usb_serial *serial)
return 0; return 0;
} }
static struct usb_serial_device_type safe_device = { static struct usb_serial_driver safe_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Safe", .name = "Safe",
.id_table = id_table, .id_table = id_table,
......
...@@ -255,7 +255,7 @@ static struct usb_driver ti_usb_driver = { ...@@ -255,7 +255,7 @@ static struct usb_driver ti_usb_driver = {
.id_table = ti_id_table_combined, .id_table = ti_id_table_combined,
}; };
static struct usb_serial_device_type ti_1port_device = { static struct usb_serial_driver ti_1port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "TI USB 3410 1 port adapter", .name = "TI USB 3410 1 port adapter",
.id_table = ti_id_table_3410, .id_table = ti_id_table_3410,
...@@ -282,7 +282,7 @@ static struct usb_serial_device_type ti_1port_device = { ...@@ -282,7 +282,7 @@ static struct usb_serial_device_type ti_1port_device = {
.write_bulk_callback = ti_bulk_out_callback, .write_bulk_callback = ti_bulk_out_callback,
}; };
static struct usb_serial_device_type ti_2port_device = { static struct usb_serial_driver ti_2port_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "TI USB 5052 2 port adapter", .name = "TI USB 5052 2 port adapter",
.id_table = ti_id_table_5052, .id_table = ti_id_table_5052,
......
...@@ -823,7 +823,7 @@ static void port_release(struct device *dev) ...@@ -823,7 +823,7 @@ static void port_release(struct device *dev)
static struct usb_serial * create_serial (struct usb_device *dev, static struct usb_serial * create_serial (struct usb_device *dev,
struct usb_interface *interface, struct usb_interface *interface,
struct usb_serial_device_type *type) struct usb_serial_driver *driver)
{ {
struct usb_serial *serial; struct usb_serial *serial;
...@@ -834,22 +834,22 @@ static struct usb_serial * create_serial (struct usb_device *dev, ...@@ -834,22 +834,22 @@ static struct usb_serial * create_serial (struct usb_device *dev,
} }
memset (serial, 0, sizeof(*serial)); memset (serial, 0, sizeof(*serial));
serial->dev = usb_get_dev(dev); serial->dev = usb_get_dev(dev);
serial->type = type; serial->type = driver;
serial->interface = interface; serial->interface = interface;
kref_init(&serial->kref); kref_init(&serial->kref);
return serial; return serial;
} }
static struct usb_serial_device_type *search_serial_device(struct usb_interface *iface) static struct usb_serial_driver *search_serial_device(struct usb_interface *iface)
{ {
struct list_head *p; struct list_head *p;
const struct usb_device_id *id; const struct usb_device_id *id;
struct usb_serial_device_type *t; struct usb_serial_driver *t;
/* List trough know devices and see if the usb id matches */ /* List trough know devices and see if the usb id matches */
list_for_each(p, &usb_serial_driver_list) { list_for_each(p, &usb_serial_driver_list) {
t = list_entry(p, struct usb_serial_device_type, driver_list); t = list_entry(p, struct usb_serial_driver, driver_list);
id = usb_match_id(iface, t->id_table); id = usb_match_id(iface, t->id_table);
if (id != NULL) { if (id != NULL) {
dbg("descriptor matches"); dbg("descriptor matches");
...@@ -872,7 +872,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -872,7 +872,7 @@ int usb_serial_probe(struct usb_interface *interface,
struct usb_endpoint_descriptor *interrupt_out_endpoint[MAX_NUM_PORTS]; struct usb_endpoint_descriptor *interrupt_out_endpoint[MAX_NUM_PORTS];
struct usb_endpoint_descriptor *bulk_in_endpoint[MAX_NUM_PORTS]; struct usb_endpoint_descriptor *bulk_in_endpoint[MAX_NUM_PORTS];
struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS]; struct usb_endpoint_descriptor *bulk_out_endpoint[MAX_NUM_PORTS];
struct usb_serial_device_type *type = NULL; struct usb_serial_driver *type = NULL;
int retval; int retval;
int minor; int minor;
int buffer_size; int buffer_size;
...@@ -1375,7 +1375,7 @@ module_exit(usb_serial_exit); ...@@ -1375,7 +1375,7 @@ module_exit(usb_serial_exit);
} \ } \
} while (0) } while (0)
static void fixup_generic(struct usb_serial_device_type *device) static void fixup_generic(struct usb_serial_driver *device)
{ {
set_to_generic_if_null(device, open); set_to_generic_if_null(device, open);
set_to_generic_if_null(device, write); set_to_generic_if_null(device, write);
...@@ -1387,28 +1387,28 @@ static void fixup_generic(struct usb_serial_device_type *device) ...@@ -1387,28 +1387,28 @@ static void fixup_generic(struct usb_serial_device_type *device)
set_to_generic_if_null(device, shutdown); set_to_generic_if_null(device, shutdown);
} }
int usb_serial_register(struct usb_serial_device_type *new_device) int usb_serial_register(struct usb_serial_driver *driver)
{ {
int retval; int retval;
fixup_generic(new_device); fixup_generic(driver);
/* Add this device to our list of devices */ /* Add this device to our list of devices */
list_add(&new_device->driver_list, &usb_serial_driver_list); list_add(&driver->driver_list, &usb_serial_driver_list);
retval = usb_serial_bus_register(new_device); retval = usb_serial_bus_register(driver);
if (retval) { if (retval) {
err("problem %d when registering driver %s", retval, new_device->name); err("problem %d when registering driver %s", retval, driver->name);
list_del(&new_device->driver_list); list_del(&driver->driver_list);
} }
else else
info("USB Serial support registered for %s", new_device->name); info("USB Serial support registered for %s", driver->name);
return retval; return retval;
} }
void usb_serial_deregister(struct usb_serial_device_type *device) void usb_serial_deregister(struct usb_serial_driver *device)
{ {
info("USB Serial deregistering driver %s", device->name); info("USB Serial deregistering driver %s", device->name);
list_del(&device->driver_list); list_del(&device->driver_list);
......
...@@ -143,7 +143,7 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void ...@@ -143,7 +143,7 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void
/** /**
* usb_serial - structure used by the usb-serial core for a device * usb_serial - structure used by the usb-serial core for a device
* @dev: pointer to the struct usb_device for this device * @dev: pointer to the struct usb_device for this device
* @type: pointer to the struct usb_serial_device_type for this device * @type: pointer to the struct usb_serial_driver for this device
* @interface: pointer to the struct usb_interface for this device * @interface: pointer to the struct usb_interface for this device
* @minor: the starting minor number for this device * @minor: the starting minor number for this device
* @num_ports: the number of ports this device has * @num_ports: the number of ports this device has
...@@ -159,7 +159,7 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void ...@@ -159,7 +159,7 @@ static inline void usb_set_serial_port_data (struct usb_serial_port *port, void
*/ */
struct usb_serial { struct usb_serial {
struct usb_device * dev; struct usb_device * dev;
struct usb_serial_device_type * type; struct usb_serial_driver * type;
struct usb_interface * interface; struct usb_interface * interface;
unsigned char minor; unsigned char minor;
unsigned char num_ports; unsigned char num_ports;
...@@ -188,11 +188,11 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data) ...@@ -188,11 +188,11 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
} }
/** /**
* usb_serial_device_type - a structure that defines a usb serial device * usb_serial_driver - describes a usb serial driver
* @owner: pointer to the module that owns this device. * @owner: pointer to the module that owns this driver.
* @name: pointer to a string that describes this device. This string used * @name: pointer to a string that describes this driver. 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 * @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 * KOBJ_NAME_LEN characters or less. This is used for the sysfs interface
* to describe the driver. * 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
...@@ -221,13 +221,13 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data) ...@@ -221,13 +221,13 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
* @shutdown: pointer to the driver's shutdown function. This will be * @shutdown: pointer to the driver's shutdown function. This will be
* called when the device is removed from the system. * called when the device is removed from the system.
* *
* This structure is defines a USB Serial device. It provides all of * This structure is defines a USB Serial driver. It provides all of
* the information that the USB serial core code needs. If the function * the information that the USB serial core code needs. If the function
* pointers are defined, then the USB serial core code will call them when * pointers are defined, then the USB serial core code will call them when
* the corresponding tty port functions are called. If they are not * the corresponding tty port functions are called. If they are not
* called, the generic serial function will be used instead. * called, the generic serial function will be used instead.
*/ */
struct usb_serial_device_type { struct usb_serial_driver {
struct module *owner; struct module *owner;
char *name; char *name;
char *short_name; char *short_name;
...@@ -269,10 +269,10 @@ struct usb_serial_device_type { ...@@ -269,10 +269,10 @@ struct usb_serial_device_type {
void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs); void (*read_bulk_callback)(struct urb *urb, struct pt_regs *regs);
void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs); void (*write_bulk_callback)(struct urb *urb, struct pt_regs *regs);
}; };
#define to_usb_serial_driver(d) container_of(d, struct usb_serial_device_type, driver) #define to_usb_serial_driver(d) container_of(d, struct usb_serial_driver, driver)
extern int usb_serial_register(struct usb_serial_device_type *new_device); extern int usb_serial_register(struct usb_serial_driver *driver);
extern void usb_serial_deregister(struct usb_serial_device_type *device); extern void usb_serial_deregister(struct usb_serial_driver *driver);
extern void usb_serial_port_softint(void *private); extern void usb_serial_port_softint(void *private);
extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
...@@ -303,10 +303,10 @@ extern void usb_serial_generic_shutdown (struct usb_serial *serial); ...@@ -303,10 +303,10 @@ extern void usb_serial_generic_shutdown (struct usb_serial *serial);
extern int usb_serial_generic_register (int debug); extern int usb_serial_generic_register (int debug);
extern void usb_serial_generic_deregister (void); extern void usb_serial_generic_deregister (void);
extern int usb_serial_bus_register (struct usb_serial_device_type *device); extern int usb_serial_bus_register (struct usb_serial_driver *device);
extern void usb_serial_bus_deregister (struct usb_serial_device_type *device); extern void usb_serial_bus_deregister (struct usb_serial_driver *device);
extern struct usb_serial_device_type usb_serial_generic_device; extern struct usb_serial_driver usb_serial_generic_device;
extern struct bus_type usb_serial_bus_type; extern struct bus_type usb_serial_bus_type;
extern struct tty_driver *usb_serial_tty_driver; extern struct tty_driver *usb_serial_tty_driver;
......
...@@ -311,7 +311,7 @@ static struct usb_driver visor_driver = { ...@@ -311,7 +311,7 @@ static struct usb_driver visor_driver = {
}; };
/* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */ /* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */
static struct usb_serial_device_type handspring_device = { static struct usb_serial_driver handspring_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Handspring Visor / Palm OS", .name = "Handspring Visor / Palm OS",
.short_name = "visor", .short_name = "visor",
...@@ -339,7 +339,7 @@ static struct usb_serial_device_type handspring_device = { ...@@ -339,7 +339,7 @@ static struct usb_serial_device_type handspring_device = {
}; };
/* All of the device info needed for the Clie UX50, TH55 Palm 5.0 devices */ /* All of the device info needed for the Clie UX50, TH55 Palm 5.0 devices */
static struct usb_serial_device_type clie_5_device = { static struct usb_serial_driver clie_5_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Sony Clie 5.0", .name = "Sony Clie 5.0",
.short_name = "clie_5", .short_name = "clie_5",
...@@ -367,7 +367,7 @@ static struct usb_serial_device_type clie_5_device = { ...@@ -367,7 +367,7 @@ static struct usb_serial_device_type clie_5_device = {
}; };
/* device info for the Sony Clie OS version 3.5 */ /* device info for the Sony Clie OS version 3.5 */
static struct usb_serial_device_type clie_3_5_device = { static struct usb_serial_driver clie_3_5_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Sony Clie 3.5", .name = "Sony Clie 3.5",
.short_name = "clie_3.5", .short_name = "clie_3.5",
......
...@@ -156,7 +156,7 @@ static void whiteheat_unthrottle (struct usb_serial_port *port); ...@@ -156,7 +156,7 @@ static void whiteheat_unthrottle (struct usb_serial_port *port);
static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs); static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs);
static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs); 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_driver whiteheat_fake_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT - (prerenumeration)", .name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm", .short_name = "whiteheatnofirm",
...@@ -169,7 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = { ...@@ -169,7 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = {
.attach = whiteheat_firmware_attach, .attach = whiteheat_firmware_attach,
}; };
static struct usb_serial_device_type whiteheat_device = { static struct usb_serial_driver whiteheat_device = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.name = "Connect Tech - WhiteHEAT", .name = "Connect Tech - WhiteHEAT",
.short_name = "whiteheat", .short_name = "whiteheat",
......
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