Commit 18fcac35 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] USB Serial: get rid of the .owner field in usb_serial_driver

Don't duplicate something that's already in struct driver.
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent ea65370d
...@@ -31,7 +31,9 @@ static struct usb_driver airprime_driver = { ...@@ -31,7 +31,9 @@ static struct usb_driver airprime_driver = {
}; };
static struct usb_serial_driver airprime_device = { static struct usb_serial_driver airprime_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "airprime", .name = "airprime",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -122,7 +122,9 @@ static struct usb_driver belkin_driver = { ...@@ -122,7 +122,9 @@ 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_driver belkin_device = { static struct usb_serial_driver belkin_device = {
.driver = {
.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",
.id_table = id_table_combined, .id_table = id_table_combined,
......
...@@ -57,13 +57,13 @@ static int usb_serial_device_probe (struct device *dev) ...@@ -57,13 +57,13 @@ static int usb_serial_device_probe (struct device *dev)
driver = port->serial->type; driver = port->serial->type;
if (driver->port_probe) { if (driver->port_probe) {
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->driver.owner)) {
dev_err(dev, "module get failed, exiting\n"); dev_err(dev, "module get failed, exiting\n");
retval = -EIO; retval = -EIO;
goto exit; goto exit;
} }
retval = driver->port_probe (port); retval = driver->port_probe (port);
module_put(driver->owner); module_put(driver->driver.owner);
if (retval) if (retval)
goto exit; goto exit;
} }
...@@ -92,13 +92,13 @@ static int usb_serial_device_remove (struct device *dev) ...@@ -92,13 +92,13 @@ static int usb_serial_device_remove (struct device *dev)
driver = port->serial->type; driver = port->serial->type;
if (driver->port_remove) { if (driver->port_remove) {
if (!try_module_get(driver->owner)) { if (!try_module_get(driver->driver.owner)) {
dev_err(dev, "module get failed, exiting\n"); dev_err(dev, "module get failed, exiting\n");
retval = -EIO; retval = -EIO;
goto exit; goto exit;
} }
retval = driver->port_remove (port); retval = driver->port_remove (port);
module_put(driver->owner); module_put(driver->driver.owner);
} }
exit: exit:
minor = port->number; minor = port->number;
...@@ -120,7 +120,6 @@ int usb_serial_bus_register(struct usb_serial_driver *driver) ...@@ -120,7 +120,6 @@ int usb_serial_bus_register(struct usb_serial_driver *driver)
driver->driver.bus = &usb_serial_bus_type; driver->driver.bus = &usb_serial_bus_type;
driver->driver.probe = usb_serial_device_probe; driver->driver.probe = usb_serial_device_probe;
driver->driver.remove = usb_serial_device_remove; driver->driver.remove = usb_serial_device_remove;
driver->driver.owner = driver->owner;
retval = driver_register(&driver->driver); retval = driver_register(&driver->driver);
......
...@@ -74,7 +74,9 @@ static struct usb_driver cp2101_driver = { ...@@ -74,7 +74,9 @@ static struct usb_driver cp2101_driver = {
}; };
static struct usb_serial_driver cp2101_device = { static struct usb_serial_driver cp2101_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "CP2101", .name = "CP2101",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 0, .num_interrupt_in = 0,
......
...@@ -84,7 +84,9 @@ static struct usb_driver cyberjack_driver = { ...@@ -84,7 +84,9 @@ static struct usb_driver cyberjack_driver = {
}; };
static struct usb_serial_driver cyberjack_device = { static struct usb_serial_driver cyberjack_device = {
.driver = {
.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",
.id_table = id_table, .id_table = id_table,
......
...@@ -177,7 +177,9 @@ static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigne ...@@ -177,7 +177,9 @@ static unsigned int cypress_buf_get(struct cypress_buf *cb, char *buf, unsigne
static struct usb_serial_driver cypress_earthmate_device = { static struct usb_serial_driver cypress_earthmate_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "DeLorme Earthmate USB", .name = "DeLorme Earthmate USB",
.short_name = "earthmate", .short_name = "earthmate",
.id_table = id_table_earthmate, .id_table = id_table_earthmate,
...@@ -204,7 +206,9 @@ static struct usb_serial_driver cypress_earthmate_device = { ...@@ -204,7 +206,9 @@ static struct usb_serial_driver cypress_earthmate_device = {
}; };
static struct usb_serial_driver cypress_hidcom_device = { static struct usb_serial_driver cypress_hidcom_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "HID->COM RS232 Adapter", .name = "HID->COM RS232 Adapter",
.short_name = "cyphidcom", .short_name = "cyphidcom",
.id_table = id_table_cyphidcomrs232, .id_table = id_table_cyphidcomrs232,
......
...@@ -504,7 +504,9 @@ static struct usb_driver digi_driver = { ...@@ -504,7 +504,9 @@ 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_driver digi_acceleport_2_device = { static struct usb_serial_driver digi_acceleport_2_device = {
.driver = {
.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",
.id_table = id_table_2, .id_table = id_table_2,
...@@ -531,7 +533,9 @@ static struct usb_serial_driver digi_acceleport_2_device = { ...@@ -531,7 +533,9 @@ static struct usb_serial_driver digi_acceleport_2_device = {
}; };
static struct usb_serial_driver digi_acceleport_4_device = { static struct usb_serial_driver digi_acceleport_4_device = {
.driver = {
.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",
.id_table = id_table_4, .id_table = id_table_4,
......
...@@ -113,7 +113,9 @@ static struct usb_driver empeg_driver = { ...@@ -113,7 +113,9 @@ static struct usb_driver empeg_driver = {
}; };
static struct usb_serial_driver empeg_device = { static struct usb_serial_driver empeg_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Empeg", .name = "Empeg",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 0, .num_interrupt_in = 0,
......
...@@ -563,7 +563,9 @@ static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base); ...@@ -563,7 +563,9 @@ 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_driver ftdi_sio_device = { static struct usb_serial_driver ftdi_sio_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "FTDI USB Serial Device", .name = "FTDI USB Serial Device",
.short_name = "ftdi_sio", .short_name = "ftdi_sio",
.id_table = id_table_combined, .id_table = id_table_combined,
......
...@@ -1470,7 +1470,9 @@ static void garmin_shutdown (struct usb_serial *serial) ...@@ -1470,7 +1470,9 @@ static void garmin_shutdown (struct usb_serial *serial)
/* All of the device info needed */ /* All of the device info needed */
static struct usb_serial_driver garmin_device = { static struct usb_serial_driver garmin_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Garmin GPS usb/tty", .name = "Garmin GPS usb/tty",
.short_name = "garmin_gps", .short_name = "garmin_gps",
.id_table = id_table, .id_table = id_table,
......
...@@ -37,7 +37,9 @@ static struct usb_device_id generic_device_ids[2]; /* Initially all zeroes. */ ...@@ -37,7 +37,9 @@ 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_driver usb_serial_generic_device = { struct usb_serial_driver usb_serial_generic_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Generic", .name = "Generic",
.short_name = "generic", .short_name = "generic",
.id_table = generic_device_ids, .id_table = generic_device_ids,
......
...@@ -45,7 +45,9 @@ static struct usb_driver hp49gp_driver = { ...@@ -45,7 +45,9 @@ static struct usb_driver hp49gp_driver = {
}; };
static struct usb_serial_driver hp49gp_device = { static struct usb_serial_driver hp49gp_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "HP4X", .name = "HP4X",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -76,7 +76,9 @@ static struct usb_device_id id_table_combined [] = { ...@@ -76,7 +76,9 @@ 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_driver edgeport_2port_device = { static struct usb_serial_driver edgeport_2port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Edgeport 2 port adapter", .name = "Edgeport 2 port adapter",
.short_name = "edgeport_2", .short_name = "edgeport_2",
.id_table = edgeport_2port_id_table, .id_table = edgeport_2port_id_table,
...@@ -104,7 +106,9 @@ static struct usb_serial_driver edgeport_2port_device = { ...@@ -104,7 +106,9 @@ static struct usb_serial_driver edgeport_2port_device = {
}; };
static struct usb_serial_driver edgeport_4port_device = { static struct usb_serial_driver edgeport_4port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Edgeport 4 port adapter", .name = "Edgeport 4 port adapter",
.short_name = "edgeport_4", .short_name = "edgeport_4",
.id_table = edgeport_4port_id_table, .id_table = edgeport_4port_id_table,
...@@ -132,7 +136,9 @@ static struct usb_serial_driver edgeport_4port_device = { ...@@ -132,7 +136,9 @@ static struct usb_serial_driver edgeport_4port_device = {
}; };
static struct usb_serial_driver edgeport_8port_device = { static struct usb_serial_driver edgeport_8port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Edgeport 8 port adapter", .name = "Edgeport 8 port adapter",
.short_name = "edgeport_8", .short_name = "edgeport_8",
.id_table = edgeport_8port_id_table, .id_table = edgeport_8port_id_table,
......
...@@ -2983,7 +2983,9 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf, ...@@ -2983,7 +2983,9 @@ static unsigned int edge_buf_get(struct edge_buf *eb, char *buf,
static struct usb_serial_driver edgeport_1port_device = { static struct usb_serial_driver edgeport_1port_device = {
.driver = {
.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",
.id_table = edgeport_1port_id_table, .id_table = edgeport_1port_id_table,
...@@ -3011,7 +3013,9 @@ static struct usb_serial_driver edgeport_1port_device = { ...@@ -3011,7 +3013,9 @@ static struct usb_serial_driver edgeport_1port_device = {
}; };
static struct usb_serial_driver edgeport_2port_device = { static struct usb_serial_driver edgeport_2port_device = {
.driver = {
.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",
.id_table = edgeport_2port_id_table, .id_table = edgeport_2port_id_table,
......
...@@ -548,7 +548,9 @@ static struct usb_driver ipaq_driver = { ...@@ -548,7 +548,9 @@ 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_driver ipaq_device = { static struct usb_serial_driver ipaq_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "PocketPC PDA", .name = "PocketPC PDA",
.id_table = ipaq_id_table, .id_table = ipaq_id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -444,7 +444,9 @@ static int ipw_disconnect(struct usb_serial_port *port) ...@@ -444,7 +444,9 @@ static int ipw_disconnect(struct usb_serial_port *port)
} }
static struct usb_serial_driver ipw_device = { static struct usb_serial_driver ipw_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "IPWireless converter", .name = "IPWireless converter",
.short_name = "ipw", .short_name = "ipw",
.id_table = usb_ipw_ids, .id_table = usb_ipw_ids,
......
...@@ -134,7 +134,9 @@ static struct usb_driver ir_driver = { ...@@ -134,7 +134,9 @@ static struct usb_driver ir_driver = {
static struct usb_serial_driver ir_device = { static struct usb_serial_driver ir_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "IR Dongle", .name = "IR Dongle",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = 1, .num_interrupt_in = 1,
......
...@@ -571,7 +571,9 @@ static struct usb_device_id keyspan_4port_ids[] = { ...@@ -571,7 +571,9 @@ 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_driver keyspan_pre_device = { static struct usb_serial_driver keyspan_pre_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan - (without firmware)", .name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm", .short_name = "keyspan_no_firm",
.id_table = keyspan_pre_ids, .id_table = keyspan_pre_ids,
...@@ -583,7 +585,9 @@ static struct usb_serial_driver keyspan_pre_device = { ...@@ -583,7 +585,9 @@ static struct usb_serial_driver keyspan_pre_device = {
}; };
static struct usb_serial_driver keyspan_1port_device = { static struct usb_serial_driver keyspan_1port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan 1 port adapter", .name = "Keyspan 1 port adapter",
.short_name = "keyspan_1", .short_name = "keyspan_1",
.id_table = keyspan_1port_ids, .id_table = keyspan_1port_ids,
...@@ -608,7 +612,9 @@ static struct usb_serial_driver keyspan_1port_device = { ...@@ -608,7 +612,9 @@ static struct usb_serial_driver keyspan_1port_device = {
}; };
static struct usb_serial_driver keyspan_2port_device = { static struct usb_serial_driver keyspan_2port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan 2 port adapter", .name = "Keyspan 2 port adapter",
.short_name = "keyspan_2", .short_name = "keyspan_2",
.id_table = keyspan_2port_ids, .id_table = keyspan_2port_ids,
...@@ -633,7 +639,9 @@ static struct usb_serial_driver keyspan_2port_device = { ...@@ -633,7 +639,9 @@ static struct usb_serial_driver keyspan_2port_device = {
}; };
static struct usb_serial_driver keyspan_4port_device = { static struct usb_serial_driver keyspan_4port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan 4 port adapter", .name = "Keyspan 4 port adapter",
.short_name = "keyspan_4", .short_name = "keyspan_4",
.id_table = keyspan_4port_ids, .id_table = keyspan_4port_ids,
......
...@@ -784,7 +784,9 @@ static void keyspan_pda_shutdown (struct usb_serial *serial) ...@@ -784,7 +784,9 @@ static void keyspan_pda_shutdown (struct usb_serial *serial)
#ifdef KEYSPAN #ifdef KEYSPAN
static struct usb_serial_driver keyspan_pda_fake_device = { static struct usb_serial_driver keyspan_pda_fake_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan PDA - (prerenumeration)", .name = "Keyspan PDA - (prerenumeration)",
.short_name = "keyspan_pda_pre", .short_name = "keyspan_pda_pre",
.id_table = id_table_fake, .id_table = id_table_fake,
...@@ -798,7 +800,9 @@ static struct usb_serial_driver keyspan_pda_fake_device = { ...@@ -798,7 +800,9 @@ static struct usb_serial_driver keyspan_pda_fake_device = {
#ifdef XIRCOM #ifdef XIRCOM
static struct usb_serial_driver xircom_pgs_fake_device = { static struct usb_serial_driver xircom_pgs_fake_device = {
.driver = {
.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",
.id_table = id_table_fake_xircom, .id_table = id_table_fake_xircom,
...@@ -811,7 +815,9 @@ static struct usb_serial_driver xircom_pgs_fake_device = { ...@@ -811,7 +815,9 @@ static struct usb_serial_driver xircom_pgs_fake_device = {
#endif #endif
static struct usb_serial_driver keyspan_pda_device = { static struct usb_serial_driver keyspan_pda_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Keyspan PDA", .name = "Keyspan PDA",
.short_name = "keyspan_pda", .short_name = "keyspan_pda",
.id_table = id_table_std, .id_table = id_table_std,
......
...@@ -124,7 +124,9 @@ static struct usb_driver kl5kusb105d_driver = { ...@@ -124,7 +124,9 @@ static struct usb_driver kl5kusb105d_driver = {
}; };
static struct usb_serial_driver kl5kusb105d_device = { static struct usb_serial_driver kl5kusb105d_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "KL5KUSB105D / PalmConnect", .name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d", .short_name = "kl5kusb105d",
.id_table = id_table, .id_table = id_table,
......
...@@ -106,7 +106,9 @@ static struct usb_driver kobil_driver = { ...@@ -106,7 +106,9 @@ static struct usb_driver kobil_driver = {
static struct usb_serial_driver kobil_device = { static struct usb_serial_driver kobil_device = {
.driver = {
.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,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -133,7 +133,9 @@ static struct usb_driver mct_u232_driver = { ...@@ -133,7 +133,9 @@ static struct usb_driver mct_u232_driver = {
}; };
static struct usb_serial_driver mct_u232_device = { static struct usb_serial_driver mct_u232_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "MCT U232", .name = "MCT U232",
.short_name = "mct_u232", .short_name = "mct_u232",
.id_table = id_table_combined, .id_table = id_table_combined,
......
...@@ -89,7 +89,9 @@ static struct usb_driver omninet_driver = { ...@@ -89,7 +89,9 @@ static struct usb_driver omninet_driver = {
static struct usb_serial_driver zyxel_omninet_device = { static struct usb_serial_driver zyxel_omninet_device = {
.driver = {
.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",
.id_table = id_table, .id_table = id_table,
......
...@@ -106,7 +106,9 @@ static struct usb_driver option_driver = { ...@@ -106,7 +106,9 @@ static struct usb_driver option_driver = {
* recognizes separately, thus num_port=1. * recognizes separately, thus num_port=1.
*/ */
static struct usb_serial_driver option_3port_device = { static struct usb_serial_driver option_3port_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Option 3G data card", .name = "Option 3G data card",
.short_name = "option", .short_name = "option",
.id_table = option_ids, .id_table = option_ids,
......
...@@ -176,7 +176,9 @@ static unsigned int pl2303_buf_get(struct pl2303_buf *pb, char *buf, ...@@ -176,7 +176,9 @@ 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_driver pl2303_device = { static struct usb_serial_driver pl2303_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "PL-2303", .name = "PL-2303",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -398,7 +398,9 @@ static int safe_startup (struct usb_serial *serial) ...@@ -398,7 +398,9 @@ static int safe_startup (struct usb_serial *serial)
} }
static struct usb_serial_driver safe_device = { static struct usb_serial_driver safe_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Safe", .name = "Safe",
.id_table = id_table, .id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE, .num_interrupt_in = NUM_DONT_CARE,
......
...@@ -256,7 +256,9 @@ static struct usb_driver ti_usb_driver = { ...@@ -256,7 +256,9 @@ static struct usb_driver ti_usb_driver = {
}; };
static struct usb_serial_driver ti_1port_device = { static struct usb_serial_driver ti_1port_device = {
.driver = {
.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,
.num_interrupt_in = 1, .num_interrupt_in = 1,
...@@ -283,7 +285,9 @@ static struct usb_serial_driver ti_1port_device = { ...@@ -283,7 +285,9 @@ static struct usb_serial_driver ti_1port_device = {
}; };
static struct usb_serial_driver ti_2port_device = { static struct usb_serial_driver ti_2port_device = {
.driver = {
.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,
.num_interrupt_in = 1, .num_interrupt_in = 1,
......
...@@ -507,7 +507,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -507,7 +507,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
/* lock this module before we call it /* lock this module before we call it
* this may fail, which means we must bail out, * this may fail, which means we must bail out,
* safe because we are called with BKL held */ * safe because we are called with BKL held */
if (!try_module_get(serial->type->owner)) { if (!try_module_get(serial->type->driver.owner)) {
retval = -ENODEV; retval = -ENODEV;
goto bailout_kref_put; goto bailout_kref_put;
} }
...@@ -522,7 +522,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) ...@@ -522,7 +522,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp)
return 0; return 0;
bailout_module_put: bailout_module_put:
module_put(serial->type->owner); module_put(serial->type->driver.owner);
bailout_kref_put: bailout_kref_put:
kref_put(&serial->kref, destroy_serial); kref_put(&serial->kref, destroy_serial);
port->open_count = 0; port->open_count = 0;
...@@ -553,7 +553,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp) ...@@ -553,7 +553,7 @@ static void serial_close(struct tty_struct *tty, struct file * filp)
port->tty = NULL; port->tty = NULL;
} }
module_put(port->serial->type->owner); module_put(port->serial->type->driver.owner);
} }
kref_put(&port->serial->kref, destroy_serial); kref_put(&port->serial->kref, destroy_serial);
...@@ -718,8 +718,8 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int ...@@ -718,8 +718,8 @@ static int serial_read_proc (char *page, char **start, off_t off, int count, int
continue; continue;
length += sprintf (page+length, "%d:", i); length += sprintf (page+length, "%d:", i);
if (serial->type->owner) if (serial->type->driver.owner)
length += sprintf (page+length, " module:%s", module_name(serial->type->owner)); length += sprintf (page+length, " module:%s", module_name(serial->type->driver.owner));
length += sprintf (page+length, " name:\"%s\"", serial->type->name); length += sprintf (page+length, " name:\"%s\"", serial->type->name);
length += sprintf (page+length, " vendor:%04x product:%04x", length += sprintf (page+length, " vendor:%04x product:%04x",
le16_to_cpu(serial->dev->descriptor.idVendor), le16_to_cpu(serial->dev->descriptor.idVendor),
...@@ -900,7 +900,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -900,7 +900,7 @@ int usb_serial_probe(struct usb_interface *interface,
if (type->probe) { if (type->probe) {
const struct usb_device_id *id; const struct usb_device_id *id;
if (!try_module_get(type->owner)) { if (!try_module_get(type->driver.owner)) {
dev_err(&interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
kfree (serial); kfree (serial);
return -EIO; return -EIO;
...@@ -908,7 +908,7 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -908,7 +908,7 @@ int usb_serial_probe(struct usb_interface *interface,
id = usb_match_id(interface, type->id_table); id = usb_match_id(interface, type->id_table);
retval = type->probe(serial, id); retval = type->probe(serial, id);
module_put(type->owner); module_put(type->driver.owner);
if (retval) { if (retval) {
dbg ("sub driver rejected device"); dbg ("sub driver rejected device");
...@@ -1007,13 +1007,13 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1007,13 +1007,13 @@ int usb_serial_probe(struct usb_interface *interface,
if (!num_ports) { if (!num_ports) {
/* if this device type has a calc_num_ports function, call it */ /* if this device type has a calc_num_ports function, call it */
if (type->calc_num_ports) { if (type->calc_num_ports) {
if (!try_module_get(type->owner)) { if (!try_module_get(type->driver.owner)) {
dev_err(&interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
kfree (serial); kfree (serial);
return -EIO; return -EIO;
} }
num_ports = type->calc_num_ports (serial); num_ports = type->calc_num_ports (serial);
module_put(type->owner); module_put(type->driver.owner);
} }
if (!num_ports) if (!num_ports)
num_ports = type->num_ports; num_ports = type->num_ports;
...@@ -1158,12 +1158,12 @@ int usb_serial_probe(struct usb_interface *interface, ...@@ -1158,12 +1158,12 @@ int usb_serial_probe(struct usb_interface *interface,
/* if this device type has an attach function, call it */ /* if this device type has an attach function, call it */
if (type->attach) { if (type->attach) {
if (!try_module_get(type->owner)) { if (!try_module_get(type->driver.owner)) {
dev_err(&interface->dev, "module get failed, exiting\n"); dev_err(&interface->dev, "module get failed, exiting\n");
goto probe_error; goto probe_error;
} }
retval = type->attach (serial); retval = type->attach (serial);
module_put(type->owner); module_put(type->driver.owner);
if (retval < 0) if (retval < 0)
goto probe_error; goto probe_error;
if (retval > 0) { if (retval > 0) {
......
...@@ -189,7 +189,6 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data) ...@@ -189,7 +189,6 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
/** /**
* usb_serial_driver - describes a usb serial driver * 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 * @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 driver in * @short_name: a pointer to a string that describes this driver in
...@@ -226,9 +225,11 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data) ...@@ -226,9 +225,11 @@ static inline void usb_set_serial_data (struct usb_serial *serial, void *data)
* 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.
*
* The driver.owner field should be set to the module owner of this driver.
*
*/ */
struct usb_serial_driver { struct usb_serial_driver {
struct module *owner;
char *name; char *name;
char *short_name; char *short_name;
const struct usb_device_id *id_table; const struct usb_device_id *id_table;
......
...@@ -312,7 +312,9 @@ static struct usb_driver visor_driver = { ...@@ -312,7 +312,9 @@ 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_driver handspring_device = { static struct usb_serial_driver handspring_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Handspring Visor / Palm OS", .name = "Handspring Visor / Palm OS",
.short_name = "visor", .short_name = "visor",
.id_table = id_table, .id_table = id_table,
...@@ -340,7 +342,9 @@ static struct usb_serial_driver handspring_device = { ...@@ -340,7 +342,9 @@ static struct usb_serial_driver 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_driver clie_5_device = { static struct usb_serial_driver clie_5_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Sony Clie 5.0", .name = "Sony Clie 5.0",
.short_name = "clie_5", .short_name = "clie_5",
.id_table = clie_id_5_table, .id_table = clie_id_5_table,
...@@ -368,7 +372,9 @@ static struct usb_serial_driver clie_5_device = { ...@@ -368,7 +372,9 @@ static struct usb_serial_driver 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_driver clie_3_5_device = { static struct usb_serial_driver clie_3_5_device = {
.driver = {
.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",
.id_table = clie_id_3_5_table, .id_table = clie_id_3_5_table,
......
...@@ -157,7 +157,9 @@ static void whiteheat_read_callback (struct urb *urb, struct pt_regs *regs); ...@@ -157,7 +157,9 @@ 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_driver whiteheat_fake_device = { static struct usb_serial_driver whiteheat_fake_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Connect Tech - WhiteHEAT - (prerenumeration)", .name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm", .short_name = "whiteheatnofirm",
.id_table = id_table_prerenumeration, .id_table = id_table_prerenumeration,
...@@ -170,7 +172,9 @@ static struct usb_serial_driver whiteheat_fake_device = { ...@@ -170,7 +172,9 @@ static struct usb_serial_driver whiteheat_fake_device = {
}; };
static struct usb_serial_driver whiteheat_device = { static struct usb_serial_driver whiteheat_device = {
.driver = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
},
.name = "Connect Tech - WhiteHEAT", .name = "Connect Tech - WhiteHEAT",
.short_name = "whiteheat", .short_name = "whiteheat",
.id_table = id_table_std, .id_table = id_table_std,
......
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