Skip to content

Commit

Permalink
[PATCH] USB Serial: rename usb_serial_device_type to usb_serial_driver
Browse files Browse the repository at this point in the history
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: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Greg Kroah-Hartman committed Oct 28, 2005
1 parent a6c8260 commit ea65370
Show file tree
Hide file tree
Showing 31 changed files with 85 additions and 90 deletions.
2 changes: 1 addition & 1 deletion drivers/usb/serial/airprime.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/belkin_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 14 additions & 14 deletions drivers/usb/serial/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

2 changes: 1 addition & 1 deletion drivers/usb/serial/cp2101.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/cyberjack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/serial/cypress_m8.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/serial/digi_acceleport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/empeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/ftdi_sio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 1 addition & 6 deletions drivers/usb/serial/garmin_gps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/hp4x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/serial/io_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions drivers/usb/serial/io_ti.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/ipaq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/ipw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/ir-usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 4 additions & 4 deletions drivers/usb/serial/keyspan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions drivers/usb/serial/keyspan_pda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/kl5kusb105.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/kobil_sct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/mct_u232.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/omninet.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/option.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/serial/safe_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading

0 comments on commit ea65370

Please sign in to comment.