mos7840.c (c69263c66e5b2a5d0c7e5a41c189b1846ae1de92) mos7840.c (4d2a7aff1062048ea59214b49ca1d915586d6d6d)
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 2624 unchanged lines hidden (view full) ---

2633
2634}
2635
2636static struct usb_driver io_driver = {
2637 .name = "mos7840",
2638 .probe = usb_serial_probe,
2639 .disconnect = usb_serial_disconnect,
2640 .id_table = moschip_id_table_combined,
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of

--- 2624 unchanged lines hidden (view full) ---

2633
2634}
2635
2636static struct usb_driver io_driver = {
2637 .name = "mos7840",
2638 .probe = usb_serial_probe,
2639 .disconnect = usb_serial_disconnect,
2640 .id_table = moschip_id_table_combined,
2641 .no_dynamic_id = 1,
2642};
2643
2644static struct usb_serial_driver moschip7840_4port_device = {
2645 .driver = {
2646 .owner = THIS_MODULE,
2647 .name = "mos7840",
2648 },
2649 .description = DRIVER_DESC,
2641};
2642
2643static struct usb_serial_driver moschip7840_4port_device = {
2644 .driver = {
2645 .owner = THIS_MODULE,
2646 .name = "mos7840",
2647 },
2648 .description = DRIVER_DESC,
2650 .usb_driver = &io_driver,
2651 .id_table = moschip_port_id_table,
2652 .num_ports = 4,
2653 .open = mos7840_open,
2654 .close = mos7840_close,
2655 .write = mos7840_write,
2656 .write_room = mos7840_write_room,
2657 .chars_in_buffer = mos7840_chars_in_buffer,
2658 .throttle = mos7840_throttle,

--- 10 unchanged lines hidden (view full) ---

2669 .get_icount = mos7840_get_icount,
2670 .attach = mos7840_startup,
2671 .disconnect = mos7840_disconnect,
2672 .release = mos7840_release,
2673 .read_bulk_callback = mos7840_bulk_in_callback,
2674 .read_int_callback = mos7840_interrupt_callback,
2675};
2676
2649 .id_table = moschip_port_id_table,
2650 .num_ports = 4,
2651 .open = mos7840_open,
2652 .close = mos7840_close,
2653 .write = mos7840_write,
2654 .write_room = mos7840_write_room,
2655 .chars_in_buffer = mos7840_chars_in_buffer,
2656 .throttle = mos7840_throttle,

--- 10 unchanged lines hidden (view full) ---

2667 .get_icount = mos7840_get_icount,
2668 .attach = mos7840_startup,
2669 .disconnect = mos7840_disconnect,
2670 .release = mos7840_release,
2671 .read_bulk_callback = mos7840_bulk_in_callback,
2672 .read_int_callback = mos7840_interrupt_callback,
2673};
2674
2675static struct usb_serial_driver * const serial_drivers[] = {
2676 &moschip7840_4port_device, NULL
2677};
2678
2677/****************************************************************************
2678 * moschip7840_init
2679 * This is called by the module subsystem, or on startup to initialize us
2680 ****************************************************************************/
2681static int __init moschip7840_init(void)
2682{
2683 int retval;
2684
2685 dbg("%s", " mos7840_init :entering..........");
2686
2679/****************************************************************************
2680 * moschip7840_init
2681 * This is called by the module subsystem, or on startup to initialize us
2682 ****************************************************************************/
2683static int __init moschip7840_init(void)
2684{
2685 int retval;
2686
2687 dbg("%s", " mos7840_init :entering..........");
2688
2687 /* Register with the usb serial */
2688 retval = usb_serial_register(&moschip7840_4port_device);
2689 retval = usb_serial_register_drivers(&io_driver, serial_drivers);
2690 if (retval == 0)
2691 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
2692 DRIVER_DESC "\n");
2689
2693
2690 if (retval)
2691 goto failed_port_device_register;
2692
2693 dbg("%s", "Entering...");
2694 printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":"
2695 DRIVER_DESC "\n");
2696
2697 /* Register with the usb */
2698 retval = usb_register(&io_driver);
2699 if (retval == 0) {
2700 dbg("%s", "Leaving...");
2701 return 0;
2702 }
2703 usb_serial_deregister(&moschip7840_4port_device);
2704failed_port_device_register:
2694 dbg("%s", "Leaving...");
2705 return retval;
2706}
2707
2708/****************************************************************************
2709 * moschip7840_exit
2710 * Called when the driver is about to be unloaded.
2711 ****************************************************************************/
2712static void __exit moschip7840_exit(void)
2713{
2714
2715 dbg("%s", " mos7840_exit :entering..........");
2716
2695 return retval;
2696}
2697
2698/****************************************************************************
2699 * moschip7840_exit
2700 * Called when the driver is about to be unloaded.
2701 ****************************************************************************/
2702static void __exit moschip7840_exit(void)
2703{
2704
2705 dbg("%s", " mos7840_exit :entering..........");
2706
2717 usb_deregister(&io_driver);
2707 usb_serial_deregister_drivers(&io_driver, serial_drivers);
2718
2708
2719 usb_serial_deregister(&moschip7840_4port_device);
2720
2721 dbg("%s", "Entering...");
2722}
2723
2724module_init(moschip7840_init);
2725module_exit(moschip7840_exit);
2726
2727/* Module information */
2728MODULE_DESCRIPTION(DRIVER_DESC);
2729MODULE_LICENSE("GPL");
2730
2731module_param(debug, bool, S_IRUGO | S_IWUSR);
2732MODULE_PARM_DESC(debug, "Debug enabled or not");
2709 dbg("%s", "Entering...");
2710}
2711
2712module_init(moschip7840_init);
2713module_exit(moschip7840_exit);
2714
2715/* Module information */
2716MODULE_DESCRIPTION(DRIVER_DESC);
2717MODULE_LICENSE("GPL");
2718
2719module_param(debug, bool, S_IRUGO | S_IWUSR);
2720MODULE_PARM_DESC(debug, "Debug enabled or not");