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 = {
.id_table = id_table,
};
static struct usb_serial_device_type airprime_device = {
static struct usb_serial_driver airprime_device = {
.owner = THIS_MODULE,
.name = "airprime",
.id_table = id_table,
......
......@@ -121,7 +121,7 @@ static struct usb_driver belkin_driver = {
};
/* 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,
.name = "Belkin / Peracom / GoHubs USB Serial Adapter",
.short_name = "belkin",
......
......@@ -18,7 +18,7 @@
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;
/*
......@@ -44,7 +44,7 @@ struct bus_type usb_serial_bus_type = {
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;
int retval = 0;
int minor;
......@@ -80,7 +80,7 @@ static int usb_serial_device_probe (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;
int retval = 0;
int minor;
......@@ -109,26 +109,26 @@ static int usb_serial_device_remove (struct device *dev)
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;
if (device->short_name)
device->driver.name = (char *)device->short_name;
if (driver->short_name)
driver->driver.name = (char *)driver->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;
device->driver.owner = device->owner;
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;
driver->driver.owner = driver->owner;
retval = driver_register(&device->driver);
retval = driver_register(&driver->driver);
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 = {
.id_table = id_table,
};
static struct usb_serial_device_type cp2101_device = {
static struct usb_serial_driver cp2101_device = {
.owner = THIS_MODULE,
.name = "CP2101",
.id_table = id_table,
......
......@@ -83,7 +83,7 @@ static struct usb_driver cyberjack_driver = {
.id_table = id_table,
};
static struct usb_serial_device_type cyberjack_device = {
static struct usb_serial_driver cyberjack_device = {
.owner = THIS_MODULE,
.name = "Reiner SCT Cyberjack USB card reader",
.short_name = "cyberjack",
......
......@@ -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 struct usb_serial_device_type cypress_earthmate_device = {
static struct usb_serial_driver cypress_earthmate_device = {
.owner = THIS_MODULE,
.name = "DeLorme Earthmate USB",
.short_name = "earthmate",
......@@ -203,7 +203,7 @@ static struct usb_serial_device_type cypress_earthmate_device = {
.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,
.name = "HID->COM RS232 Adapter",
.short_name = "cyphidcom",
......
......@@ -503,7 +503,7 @@ static struct usb_driver digi_driver = {
/* 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,
.name = "Digi 2 port USB adapter",
.short_name = "digi_2",
......@@ -530,7 +530,7 @@ static struct usb_serial_device_type digi_acceleport_2_device = {
.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,
.name = "Digi 4 port USB adapter",
.short_name = "digi_4",
......
......@@ -112,7 +112,7 @@ static struct usb_driver empeg_driver = {
.id_table = id_table,
};
static struct usb_serial_device_type empeg_device = {
static struct usb_serial_driver empeg_device = {
.owner = THIS_MODULE,
.name = "Empeg",
.id_table = id_table,
......
......@@ -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_to_divisor (int baud);
static struct usb_serial_device_type ftdi_sio_device = {
static struct usb_serial_driver ftdi_sio_device = {
.owner = THIS_MODULE,
.name = "FTDI USB Serial Device",
.short_name = "ftdi_sio",
......
......@@ -1468,13 +1468,8 @@ static void garmin_shutdown (struct usb_serial *serial)
}
/* All of the device info needed */
static struct usb_serial_device_type garmin_device = {
static struct usb_serial_driver garmin_device = {
.owner = THIS_MODULE,
.name = "Garmin GPS usb/tty",
.short_name = "garmin_gps",
......
......@@ -36,7 +36,7 @@ MODULE_PARM_DESC(product, "User specified USB idProduct");
static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */
/* 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,
.name = "Generic",
.short_name = "generic",
......
......@@ -44,7 +44,7 @@ static struct usb_driver hp49gp_driver = {
.id_table = id_table,
};
static struct usb_serial_device_type hp49gp_device = {
static struct usb_serial_driver hp49gp_device = {
.owner = THIS_MODULE,
.name = "HP4X",
.id_table = id_table,
......
......@@ -75,7 +75,7 @@ static struct usb_device_id 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,
.name = "Edgeport 2 port adapter",
.short_name = "edgeport_2",
......@@ -103,7 +103,7 @@ static struct usb_serial_device_type edgeport_2port_device = {
.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,
.name = "Edgeport 4 port adapter",
.short_name = "edgeport_4",
......@@ -131,7 +131,7 @@ static struct usb_serial_device_type edgeport_4port_device = {
.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,
.name = "Edgeport 8 port adapter",
.short_name = "edgeport_8",
......
......@@ -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,
.name = "Edgeport TI 1 port adapter",
.short_name = "edgeport_ti_1",
......@@ -3010,7 +3010,7 @@ static struct usb_serial_device_type edgeport_1port_device = {
.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,
.name = "Edgeport TI 2 port adapter",
.short_name = "edgeport_ti_2",
......
......@@ -547,7 +547,7 @@ static struct usb_driver ipaq_driver = {
/* 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,
.name = "PocketPC PDA",
.id_table = ipaq_id_table,
......
......@@ -443,7 +443,7 @@ static int ipw_disconnect(struct usb_serial_port *port)
return 0;
}
static struct usb_serial_device_type ipw_device = {
static struct usb_serial_driver ipw_device = {
.owner = THIS_MODULE,
.name = "IPWireless converter",
.short_name = "ipw",
......
......@@ -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,
.name = "IR Dongle",
.id_table = id_table,
......
......@@ -570,7 +570,7 @@ static struct usb_device_id keyspan_4port_ids[] = {
};
/* 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,
.name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm",
......@@ -582,7 +582,7 @@ static struct usb_serial_device_type keyspan_pre_device = {
.attach = keyspan_fake_startup,
};
static struct usb_serial_device_type keyspan_1port_device = {
static struct usb_serial_driver keyspan_1port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 1 port adapter",
.short_name = "keyspan_1",
......@@ -607,7 +607,7 @@ static struct usb_serial_device_type keyspan_1port_device = {
.shutdown = keyspan_shutdown,
};
static struct usb_serial_device_type keyspan_2port_device = {
static struct usb_serial_driver keyspan_2port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 2 port adapter",
.short_name = "keyspan_2",
......@@ -632,7 +632,7 @@ static struct usb_serial_device_type keyspan_2port_device = {
.shutdown = keyspan_shutdown,
};
static struct usb_serial_device_type keyspan_4port_device = {
static struct usb_serial_driver keyspan_4port_device = {
.owner = THIS_MODULE,
.name = "Keyspan 4 port adapter",
.short_name = "keyspan_4",
......
......@@ -783,7 +783,7 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
}
#ifdef KEYSPAN
static struct usb_serial_device_type keyspan_pda_fake_device = {
static struct usb_serial_driver keyspan_pda_fake_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA - (prerenumeration)",
.short_name = "keyspan_pda_pre",
......@@ -797,7 +797,7 @@ static struct usb_serial_device_type keyspan_pda_fake_device = {
#endif
#ifdef XIRCOM
static struct usb_serial_device_type xircom_pgs_fake_device = {
static struct usb_serial_driver xircom_pgs_fake_device = {
.owner = THIS_MODULE,
.name = "Xircom / Entregra PGS - (prerenumeration)",
.short_name = "xircom_no_firm",
......@@ -810,7 +810,7 @@ static struct usb_serial_device_type xircom_pgs_fake_device = {
};
#endif
static struct usb_serial_device_type keyspan_pda_device = {
static struct usb_serial_driver keyspan_pda_device = {
.owner = THIS_MODULE,
.name = "Keyspan PDA",
.short_name = "keyspan_pda",
......
......@@ -123,7 +123,7 @@ static struct usb_driver kl5kusb105d_driver = {
.id_table = id_table,
};
static struct usb_serial_device_type kl5kusb105d_device = {
static struct usb_serial_driver kl5kusb105d_device = {
.owner = THIS_MODULE,
.name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d",
......
......@@ -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,
.name = "KOBIL USB smart card terminal",
.id_table = id_table,
......
......@@ -132,7 +132,7 @@ static struct usb_driver mct_u232_driver = {
.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,
.name = "MCT U232",
.short_name = "mct_u232",
......
......@@ -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,
.name = "ZyXEL - omni.net lcd plus usb",
.short_name = "omninet",
......
......@@ -105,7 +105,7 @@ static struct usb_driver option_driver = {
/* The card has three separate interfaces, wich the serial driver
* 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,
.name = "Option 3G data card",
.short_name = "option",
......
......@@ -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 */
static struct usb_serial_device_type pl2303_device = {
static struct usb_serial_driver pl2303_device = {
.owner = THIS_MODULE,
.name = "PL-2303",
.id_table = id_table,
......
......@@ -397,7 +397,7 @@ static int safe_startup (struct usb_serial *serial)
return 0;
}
static struct usb_serial_device_type safe_device = {
static struct usb_serial_driver safe_device = {
.owner = THIS_MODULE,
.name = "Safe",
.id_table = id_table,
......
......@@ -255,7 +255,7 @@ static struct usb_driver ti_usb_driver = {
.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,
.name = "TI USB 3410 1 port adapter",
.id_table = ti_id_table_3410,
......@@ -282,7 +282,7 @@ static struct usb_serial_device_type ti_1port_device = {
.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,
.name = "TI USB 5052 2 port adapter",
.id_table = ti_id_table_5052,
......
......@@ -823,7 +823,7 @@ static void port_release(struct device *dev)
static struct usb_serial * create_serial (struct usb_device *dev,
struct usb_interface *interface,
struct usb_serial_device_type *type)
struct usb_serial_driver *driver)
{
struct usb_serial *serial;
......@@ -834,22 +834,22 @@ static struct usb_serial * create_serial (struct usb_device *dev,
}
memset (serial, 0, sizeof(*serial));
serial->dev = usb_get_dev(dev);
serial->type = type;
serial->type = driver;
serial->interface = interface;
kref_init(&serial->kref);
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;
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_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);
if (id != NULL) {
dbg("descriptor matches");
......@@ -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 *bulk_in_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 minor;
int buffer_size;
......@@ -1375,7 +1375,7 @@ module_exit(usb_serial_exit);
} \
} 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, write);
......@@ -1387,28 +1387,28 @@ static void fixup_generic(struct usb_serial_device_type *device)
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;
fixup_generic(new_device);
fixup_generic(driver);
/* 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) {
err("problem %d when registering driver %s", retval, new_device->name);
list_del(&new_device->driver_list);
err("problem %d when registering driver %s", retval, driver->name);
list_del(&driver->driver_list);
}
else
info("USB Serial support registered for %s", new_device->name);
info("USB Serial support registered for %s", driver->name);
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);
list_del(&device->driver_list);
......
......@@ -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
* @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
* @minor: the starting minor number for this device
* @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
*/
struct usb_serial {
struct usb_device * dev;
struct usb_serial_device_type * type;
struct usb_serial_driver * type;
struct usb_interface * interface;
unsigned char minor;
unsigned char num_ports;
......@@ -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
* @owner: pointer to the module that owns this device.
* @name: pointer to a string that describes this device. This string used
* usb_serial_driver - describes a usb serial driver
* @owner: pointer to the module that owns this driver.
* @name: 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 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
* to describe the driver.
* @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)
* @shutdown: pointer to the driver's shutdown function. This will be
* 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
* pointers are defined, then the USB serial core code will call them when
* the corresponding tty port functions are called. If they are not
* called, the generic serial function will be used instead.
*/
struct usb_serial_device_type {
struct usb_serial_driver {
struct module *owner;
char *name;
char *short_name;
......@@ -269,10 +269,10 @@ struct usb_serial_device_type {
void (*read_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 void usb_serial_deregister(struct usb_serial_device_type *device);
extern int usb_serial_register(struct usb_serial_driver *driver);
extern void usb_serial_deregister(struct usb_serial_driver *driver);
extern void usb_serial_port_softint(void *private);
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);
extern int usb_serial_generic_register (int debug);
extern void usb_serial_generic_deregister (void);
extern int usb_serial_bus_register (struct usb_serial_device_type *device);
extern void usb_serial_bus_deregister (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_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 tty_driver *usb_serial_tty_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 */
static struct usb_serial_device_type handspring_device = {
static struct usb_serial_driver handspring_device = {
.owner = THIS_MODULE,
.name = "Handspring Visor / Palm OS",
.short_name = "visor",
......@@ -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 */
static struct usb_serial_device_type clie_5_device = {
static struct usb_serial_driver clie_5_device = {
.owner = THIS_MODULE,
.name = "Sony Clie 5.0",
.short_name = "clie_5",
......@@ -367,7 +367,7 @@ static struct usb_serial_device_type clie_5_device = {
};
/* 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,
.name = "Sony Clie 3.5",
.short_name = "clie_3.5",
......
......@@ -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_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,
.name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm",
......@@ -169,7 +169,7 @@ static struct usb_serial_device_type whiteheat_fake_device = {
.attach = whiteheat_firmware_attach,
};
static struct usb_serial_device_type whiteheat_device = {
static struct usb_serial_driver whiteheat_device = {
.owner = THIS_MODULE,
.name = "Connect Tech - 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