diff options
Diffstat (limited to 'drivers/usb/serial/opticon.c')
-rw-r--r-- | drivers/usb/serial/opticon.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c index 691f57a9d712..82cc9d202b83 100644 --- a/drivers/usb/serial/opticon.c +++ b/drivers/usb/serial/opticon.c @@ -32,7 +32,7 @@ * an examples of 1D barcode types are EAN, UPC, Code39, IATA etc.. */ #define DRIVER_DESC "Opticon USB barcode to serial driver (1D)" -static int debug; +static bool debug; static const struct usb_device_id id_table[] = { { USB_DEVICE(0x065a, 0x0009) }, @@ -604,7 +604,6 @@ static struct usb_driver opticon_driver = { .suspend = opticon_suspend, .resume = opticon_resume, .id_table = id_table, - .no_dynamic_id = 1, }; static struct usb_serial_driver opticon_device = { @@ -613,7 +612,6 @@ static struct usb_serial_driver opticon_device = { .name = "opticon", }, .id_table = id_table, - .usb_driver = &opticon_driver, .num_ports = 1, .attach = opticon_startup, .open = opticon_open, @@ -629,27 +627,12 @@ static struct usb_serial_driver opticon_device = { .tiocmset = opticon_tiocmset, }; -static int __init opticon_init(void) -{ - int retval; - - retval = usb_serial_register(&opticon_device); - if (retval) - return retval; - retval = usb_register(&opticon_driver); - if (retval) - usb_serial_deregister(&opticon_device); - return retval; -} +static struct usb_serial_driver * const serial_drivers[] = { + &opticon_device, NULL +}; -static void __exit opticon_exit(void) -{ - usb_deregister(&opticon_driver); - usb_serial_deregister(&opticon_device); -} +module_usb_serial_driver(opticon_driver, serial_drivers); -module_init(opticon_init); -module_exit(opticon_exit); MODULE_DESCRIPTION(DRIVER_DESC); MODULE_LICENSE("GPL"); |