.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
- .no_dynamic_id = 1,
};
static struct usb_serial_driver qcaux_device = {
.name = "qcaux",
},
.id_table = id_table,
- .usb_driver = &qcaux_driver,
.num_ports = 1,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &qcaux_device, NULL
+};
+
static int __init qcaux_init(void)
{
- int retval;
-
- retval = usb_serial_register(&qcaux_device);
- if (retval)
- return retval;
- retval = usb_register(&qcaux_driver);
- if (retval)
- usb_serial_deregister(&qcaux_device);
- return retval;
+ return usb_serial_register_drivers(&qcaux_driver, serial_drivers);
}
static void __exit qcaux_exit(void)
{
- usb_deregister(&qcaux_driver);
- usb_serial_deregister(&qcaux_device);
+ usb_serial_deregister_drivers(&qcaux_driver, serial_drivers);
}
module_init(qcaux_init);
},
.description = "Qualcomm USB modem",
.id_table = id_table,
- .usb_driver = &qcdriver,
.num_ports = 1,
.probe = qcprobe,
.open = usb_wwan_open,
#endif
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &qcdevice, NULL
+};
+
static int __init qcinit(void)
{
- int retval;
-
- retval = usb_serial_register(&qcdevice);
- if (retval)
- return retval;
-
- retval = usb_register(&qcdriver);
- if (retval) {
- usb_serial_deregister(&qcdevice);
- return retval;
- }
-
- return 0;
+ return usb_serial_register_drivers(&qcdriver, serial_drivers);
}
static void __exit qcexit(void)
{
- usb_deregister(&qcdriver);
- usb_serial_deregister(&qcdevice);
+ usb_serial_deregister_drivers(&qcdriver, serial_drivers);
}
module_init(qcinit);
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
- .no_dynamic_id = 1,
};
static const __u16 crc10_table[256] = {
.name = "safe_serial",
},
.id_table = id_table,
- .usb_driver = &safe_driver,
.num_ports = 1,
.process_read_urb = safe_process_read_urb,
.prepare_write_buffer = safe_prepare_write_buffer,
.attach = safe_startup,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &safe_device, NULL
+};
+
static int __init safe_init(void)
{
- int i, retval;
+ int i;
printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
DRIVER_DESC "\n");
}
}
- retval = usb_serial_register(&safe_device);
- if (retval)
- goto failed_usb_serial_register;
- retval = usb_register(&safe_driver);
- if (retval)
- goto failed_usb_register;
-
- return 0;
-failed_usb_register:
- usb_serial_deregister(&safe_device);
-failed_usb_serial_register:
- return retval;
+ return usb_serial_register_drivers(&safe_driver, serial_drivers);
}
static void __exit safe_exit(void)
{
- usb_deregister(&safe_driver);
- usb_serial_deregister(&safe_device);
+ usb_serial_deregister_drivers(&safe_driver, serial_drivers);
}
module_init(safe_init);
.name = "siemens_mpi",
},
.id_table = id_table,
- .usb_driver = &siemens_usb_mpi_driver,
.num_ports = 1,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &siemens_usb_mpi_device, NULL
+};
+
static int __init siemens_usb_mpi_init(void)
{
int retval;
- retval = usb_serial_register(&siemens_usb_mpi_device);
- if (retval)
- goto failed_usb_serial_register;
- retval = usb_register(&siemens_usb_mpi_driver);
- if (retval)
- goto failed_usb_register;
- printk(KERN_INFO DRIVER_DESC "\n");
- printk(KERN_INFO DRIVER_VERSION " " DRIVER_AUTHOR "\n");
- return retval;
-failed_usb_register:
- usb_serial_deregister(&siemens_usb_mpi_device);
-failed_usb_serial_register:
+ retval = usb_serial_register_drivers(&siemens_usb_mpi_driver,
+ serial_drivers);
+ if (retval == 0) {
+ printk(KERN_INFO DRIVER_DESC "\n");
+ printk(KERN_INFO DRIVER_VERSION " " DRIVER_AUTHOR "\n");
+ }
return retval;
}
static void __exit siemens_usb_mpi_exit(void)
{
- usb_deregister(&siemens_usb_mpi_driver);
- usb_serial_deregister(&siemens_usb_mpi_device);
+ usb_serial_deregister_drivers(&siemens_usb_mpi_driver, serial_drivers);
}
module_init(siemens_usb_mpi_init);
.resume = usb_serial_resume,
.reset_resume = sierra_reset_resume,
.id_table = id_table,
- .no_dynamic_id = 1,
.supports_autosuspend = 1,
};
},
.description = "Sierra USB modem",
.id_table = id_table,
- .usb_driver = &sierra_driver,
.calc_num_ports = sierra_calc_num_ports,
.probe = sierra_probe,
.open = sierra_open,
.read_int_callback = sierra_instat_callback,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &sierra_device, NULL
+};
+
/* Functions used by new usb-serial code. */
static int __init sierra_init(void)
{
int retval;
- retval = usb_serial_register(&sierra_device);
- if (retval)
- goto failed_device_register;
-
-
- retval = usb_register(&sierra_driver);
- if (retval)
- goto failed_driver_register;
-
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
-
- return 0;
-failed_driver_register:
- usb_serial_deregister(&sierra_device);
-failed_device_register:
+ retval = usb_serial_register_drivers(&sierra_driver, serial_drivers);
+ if (retval == 0)
+ printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+ DRIVER_DESC "\n");
return retval;
}
static void __exit sierra_exit(void)
{
- usb_deregister(&sierra_driver);
- usb_serial_deregister(&sierra_device);
+ usb_serial_deregister_drivers(&sierra_driver, serial_drivers);
}
module_init(sierra_init);
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
- .no_dynamic_id = 1,
};
.name = "SPCP8x5",
},
.id_table = id_table,
- .usb_driver = &spcp8x5_driver,
.num_ports = 1,
.open = spcp8x5_open,
.dtr_rts = spcp8x5_dtr_rts,
.process_read_urb = spcp8x5_process_read_urb,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &spcp8x5_device, NULL
+};
+
static int __init spcp8x5_init(void)
{
int retval;
- retval = usb_serial_register(&spcp8x5_device);
- if (retval)
- goto failed_usb_serial_register;
- retval = usb_register(&spcp8x5_driver);
- if (retval)
- goto failed_usb_register;
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
- return 0;
-failed_usb_register:
- usb_serial_deregister(&spcp8x5_device);
-failed_usb_serial_register:
+
+ retval = usb_serial_register_drivers(&spcp8x5_driver, serial_drivers);
+ if (retval == 0)
+ printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+ DRIVER_DESC "\n");
return retval;
}
static void __exit spcp8x5_exit(void)
{
- usb_deregister(&spcp8x5_driver);
- usb_serial_deregister(&spcp8x5_device);
+ usb_serial_deregister_drivers(&spcp8x5_driver, serial_drivers);
}
module_init(spcp8x5_init);
.id_table = id_table,
.suspend = usb_serial_suspend,
.resume = usb_serial_resume,
- .no_dynamic_id = 1,
.supports_autosuspend = 1,
};
},
.description = DRIVER_DESC,
.id_table = id_table,
- .usb_driver = &ssu100_driver,
.num_ports = 1,
.open = ssu100_open,
.close = ssu100_close,
.disconnect = usb_serial_generic_disconnect,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &ssu100_device, NULL
+};
+
static int __init ssu100_init(void)
{
int retval;
dbg("%s", __func__);
- /* register with usb-serial */
- retval = usb_serial_register(&ssu100_device);
-
- if (retval)
- goto failed_usb_sio_register;
-
- retval = usb_register(&ssu100_driver);
- if (retval)
- goto failed_usb_register;
-
- printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
- DRIVER_DESC "\n");
-
- return 0;
-
-failed_usb_register:
- usb_serial_deregister(&ssu100_device);
-failed_usb_sio_register:
+ retval = usb_serial_register_drivers(&ssu100_driver, serial_drivers);
+ if (retval == 0)
+ printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
+ DRIVER_DESC "\n");
return retval;
}
static void __exit ssu100_exit(void)
{
- usb_deregister(&ssu100_driver);
- usb_serial_deregister(&ssu100_device);
+ usb_serial_deregister_drivers(&ssu100_driver, serial_drivers);
}
module_init(ssu100_init);
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table,
- .no_dynamic_id = 1,
};
static struct usb_serial_driver symbol_device = {
.name = "symbol",
},
.id_table = id_table,
- .usb_driver = &symbol_driver,
.num_ports = 1,
.attach = symbol_startup,
.open = symbol_open,
.unthrottle = symbol_unthrottle,
};
+static struct usb_serial_driver * const serial_drivers[] = {
+ &symbol_device, NULL
+};
+
static int __init symbol_init(void)
{
- int retval;
-
- retval = usb_serial_register(&symbol_device);
- if (retval)
- return retval;
- retval = usb_register(&symbol_driver);
- if (retval)
- usb_serial_deregister(&symbol_device);
- return retval;
+ return usb_serial_register_drivers(&symbol_driver, serial_drivers);
}
static void __exit symbol_exit(void)
{
- usb_deregister(&symbol_driver);
- usb_serial_deregister(&symbol_device);
+ usb_serial_deregister_drivers(&symbol_driver, serial_drivers);
}
module_init(symbol_init);