Don't duplicate something that's already in struct driver.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
};
static struct usb_serial_driver airprime_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "airprime",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
/* All of the device info needed for the serial converters */
static struct usb_serial_driver belkin_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Belkin / Peracom / GoHubs USB Serial Adapter",
.short_name = "belkin",
.id_table = id_table_combined,
driver = port->serial->type;
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");
retval = -EIO;
goto exit;
}
retval = driver->port_probe (port);
- module_put(driver->owner);
+ module_put(driver->driver.owner);
if (retval)
goto exit;
}
driver = port->serial->type;
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");
retval = -EIO;
goto exit;
}
retval = driver->port_remove (port);
- module_put(driver->owner);
+ module_put(driver->driver.owner);
}
exit:
minor = port->number;
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(&driver->driver);
};
static struct usb_serial_driver cp2101_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "CP2101",
.id_table = id_table,
.num_interrupt_in = 0,
};
static struct usb_serial_driver cyberjack_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Reiner SCT Cyberjack USB card reader",
.short_name = "cyberjack",
.id_table = id_table,
static struct usb_serial_driver cypress_earthmate_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "DeLorme Earthmate USB",
.short_name = "earthmate",
.id_table = id_table_earthmate,
};
static struct usb_serial_driver cypress_hidcom_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "HID->COM RS232 Adapter",
.short_name = "cyphidcom",
.id_table = id_table_cyphidcomrs232,
/* device info needed for the Digi serial converter */
static struct usb_serial_driver digi_acceleport_2_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Digi 2 port USB adapter",
.short_name = "digi_2",
.id_table = id_table_2,
};
static struct usb_serial_driver digi_acceleport_4_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Digi 4 port USB adapter",
.short_name = "digi_4",
.id_table = id_table_4,
};
static struct usb_serial_driver empeg_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Empeg",
.id_table = id_table,
.num_interrupt_in = 0,
static __u32 ftdi_232bm_baud_to_divisor (int baud);
static struct usb_serial_driver ftdi_sio_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "FTDI USB Serial Device",
.short_name = "ftdi_sio",
.id_table = id_table_combined,
/* All of the device info needed */
static struct usb_serial_driver garmin_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Garmin GPS usb/tty",
.short_name = "garmin_gps",
.id_table = id_table,
/* All of the device info needed for the Generic Serial Converter */
struct usb_serial_driver usb_serial_generic_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Generic",
.short_name = "generic",
.id_table = generic_device_ids,
};
static struct usb_serial_driver hp49gp_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "HP4X",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
MODULE_DEVICE_TABLE (usb, id_table_combined);
static struct usb_serial_driver edgeport_2port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Edgeport 2 port adapter",
.short_name = "edgeport_2",
.id_table = edgeport_2port_id_table,
};
static struct usb_serial_driver edgeport_4port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Edgeport 4 port adapter",
.short_name = "edgeport_4",
.id_table = edgeport_4port_id_table,
};
static struct usb_serial_driver edgeport_8port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Edgeport 8 port adapter",
.short_name = "edgeport_8",
.id_table = edgeport_8port_id_table,
static struct usb_serial_driver edgeport_1port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Edgeport TI 1 port adapter",
.short_name = "edgeport_ti_1",
.id_table = edgeport_1port_id_table,
};
static struct usb_serial_driver edgeport_2port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Edgeport TI 2 port adapter",
.short_name = "edgeport_ti_2",
.id_table = edgeport_2port_id_table,
/* All of the device info needed for the Compaq iPAQ */
static struct usb_serial_driver ipaq_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "PocketPC PDA",
.id_table = ipaq_id_table,
.num_interrupt_in = NUM_DONT_CARE,
}
static struct usb_serial_driver ipw_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "IPWireless converter",
.short_name = "ipw",
.id_table = usb_ipw_ids,
static struct usb_serial_driver ir_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "IR Dongle",
.id_table = id_table,
.num_interrupt_in = 1,
/* Structs for the devices, pre and post renumeration. */
static struct usb_serial_driver keyspan_pre_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan - (without firmware)",
.short_name = "keyspan_no_firm",
.id_table = keyspan_pre_ids,
};
static struct usb_serial_driver keyspan_1port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan 1 port adapter",
.short_name = "keyspan_1",
.id_table = keyspan_1port_ids,
};
static struct usb_serial_driver keyspan_2port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan 2 port adapter",
.short_name = "keyspan_2",
.id_table = keyspan_2port_ids,
};
static struct usb_serial_driver keyspan_4port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan 4 port adapter",
.short_name = "keyspan_4",
.id_table = keyspan_4port_ids,
#ifdef KEYSPAN
static struct usb_serial_driver keyspan_pda_fake_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan PDA - (prerenumeration)",
.short_name = "keyspan_pda_pre",
.id_table = id_table_fake,
#ifdef XIRCOM
static struct usb_serial_driver xircom_pgs_fake_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Xircom / Entregra PGS - (prerenumeration)",
.short_name = "xircom_no_firm",
.id_table = id_table_fake_xircom,
#endif
static struct usb_serial_driver keyspan_pda_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Keyspan PDA",
.short_name = "keyspan_pda",
.id_table = id_table_std,
};
static struct usb_serial_driver kl5kusb105d_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "KL5KUSB105D / PalmConnect",
.short_name = "kl5kusb105d",
.id_table = id_table,
static struct usb_serial_driver kobil_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "KOBIL USB smart card terminal",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
};
static struct usb_serial_driver mct_u232_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "MCT U232",
.short_name = "mct_u232",
.id_table = id_table_combined,
static struct usb_serial_driver zyxel_omninet_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "ZyXEL - omni.net lcd plus usb",
.short_name = "omninet",
.id_table = id_table,
* recognizes separately, thus num_port=1.
*/
static struct usb_serial_driver option_3port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Option 3G data card",
.short_name = "option",
.id_table = option_ids,
/* All of the device info needed for the PL2303 SIO serial converter */
static struct usb_serial_driver pl2303_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "PL-2303",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
}
static struct usb_serial_driver safe_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Safe",
.id_table = id_table,
.num_interrupt_in = NUM_DONT_CARE,
};
static struct usb_serial_driver ti_1port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "TI USB 3410 1 port adapter",
.id_table = ti_id_table_3410,
.num_interrupt_in = 1,
};
static struct usb_serial_driver ti_2port_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "TI USB 5052 2 port adapter",
.id_table = ti_id_table_5052,
.num_interrupt_in = 1,
/* lock this module before we call it
* this may fail, which means we must bail out,
* 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;
goto bailout_kref_put;
}
return 0;
bailout_module_put:
- module_put(serial->type->owner);
+ module_put(serial->type->driver.owner);
bailout_kref_put:
kref_put(&serial->kref, destroy_serial);
port->open_count = 0;
port->tty = NULL;
}
- module_put(port->serial->type->owner);
+ module_put(port->serial->type->driver.owner);
}
kref_put(&port->serial->kref, destroy_serial);
continue;
length += sprintf (page+length, "%d:", i);
- if (serial->type->owner)
- length += sprintf (page+length, " module:%s", module_name(serial->type->owner));
+ if (serial->type->driver.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, " vendor:%04x product:%04x",
le16_to_cpu(serial->dev->descriptor.idVendor),
if (type->probe) {
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");
kfree (serial);
return -EIO;
id = usb_match_id(interface, type->id_table);
retval = type->probe(serial, id);
- module_put(type->owner);
+ module_put(type->driver.owner);
if (retval) {
dbg ("sub driver rejected device");
if (!num_ports) {
/* if this device type has a calc_num_ports function, call it */
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");
kfree (serial);
return -EIO;
}
num_ports = type->calc_num_ports (serial);
- module_put(type->owner);
+ module_put(type->driver.owner);
}
if (!num_ports)
num_ports = type->num_ports;
/* if this device type has an attach function, call it */
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");
goto probe_error;
}
retval = type->attach (serial);
- module_put(type->owner);
+ module_put(type->driver.owner);
if (retval < 0)
goto probe_error;
if (retval > 0) {
/**
* 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 driver in
* 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.
+ *
+ * The driver.owner field should be set to the module owner of this driver.
+ *
*/
struct usb_serial_driver {
- struct module *owner;
char *name;
char *short_name;
const struct usb_device_id *id_table;
/* All of the device info needed for the Handspring Visor, and Palm 4.0 devices */
static struct usb_serial_driver handspring_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Handspring Visor / Palm OS",
.short_name = "visor",
.id_table = id_table,
/* All of the device info needed for the Clie UX50, TH55 Palm 5.0 devices */
static struct usb_serial_driver clie_5_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Sony Clie 5.0",
.short_name = "clie_5",
.id_table = clie_id_5_table,
/* device info for the Sony Clie OS version 3.5 */
static struct usb_serial_driver clie_3_5_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Sony Clie 3.5",
.short_name = "clie_3.5",
.id_table = clie_id_3_5_table,
static void whiteheat_write_callback (struct urb *urb, struct pt_regs *regs);
static struct usb_serial_driver whiteheat_fake_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Connect Tech - WhiteHEAT - (prerenumeration)",
.short_name = "whiteheatnofirm",
.id_table = id_table_prerenumeration,
};
static struct usb_serial_driver whiteheat_device = {
- .owner = THIS_MODULE,
+ .driver = {
+ .owner = THIS_MODULE,
+ },
.name = "Connect Tech - WhiteHEAT",
.short_name = "whiteheat",
.id_table = id_table_std,