diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:57:37 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:39:22 -0500 |
commit | 69276a33bd1d272dc9c3bd577038954811bd1831 (patch) | |
tree | f625348fb828ddda4a329a8c7f139deb489045e0 /drivers/staging | |
parent | 29618e9fb5507b9fcf07f739a8506a3640495945 (diff) |
usb-serial: use new registration API in staging drivers
This patch (as1530) modifies the following usb-serial drivers from
drivers/staging to utilize the new usb_serial_{de}register_drivers()
routines:
quatech_usb2 and serqt_usb2.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/quatech_usb2/quatech_usb2.c | 32 | ||||
-rw-r--r-- | drivers/staging/serqt_usb2/serqt_usb2.c | 30 |
2 files changed, 19 insertions, 43 deletions
diff --git a/drivers/staging/quatech_usb2/quatech_usb2.c b/drivers/staging/quatech_usb2/quatech_usb2.c index 897a3a99c794..b8a078abd6c7 100644 --- a/drivers/staging/quatech_usb2/quatech_usb2.c +++ b/drivers/staging/quatech_usb2/quatech_usb2.c | |||
@@ -135,7 +135,6 @@ static struct usb_driver quausb2_usb_driver = { | |||
135 | .probe = usb_serial_probe, | 135 | .probe = usb_serial_probe, |
136 | .disconnect = usb_serial_disconnect, | 136 | .disconnect = usb_serial_disconnect, |
137 | .id_table = quausb2_id_table, | 137 | .id_table = quausb2_id_table, |
138 | .no_dynamic_id = 1, | ||
139 | }; | 138 | }; |
140 | 139 | ||
141 | /** | 140 | /** |
@@ -1942,7 +1941,6 @@ static struct usb_serial_driver quatech2_device = { | |||
1942 | .name = "quatech_usb2", | 1941 | .name = "quatech_usb2", |
1943 | }, | 1942 | }, |
1944 | .description = DRIVER_DESC, | 1943 | .description = DRIVER_DESC, |
1945 | .usb_driver = &quausb2_usb_driver, | ||
1946 | .id_table = quausb2_id_table, | 1944 | .id_table = quausb2_id_table, |
1947 | .num_ports = 8, | 1945 | .num_ports = 8, |
1948 | .open = qt2_open, | 1946 | .open = qt2_open, |
@@ -1964,37 +1962,27 @@ static struct usb_serial_driver quatech2_device = { | |||
1964 | .write_bulk_callback = qt2_write_bulk_callback, | 1962 | .write_bulk_callback = qt2_write_bulk_callback, |
1965 | }; | 1963 | }; |
1966 | 1964 | ||
1965 | static struct usb_serial_driver * const serial_drivers[] = { | ||
1966 | &quatech2_device, NULL | ||
1967 | }; | ||
1968 | |||
1967 | static int __init quausb2_usb_init(void) | 1969 | static int __init quausb2_usb_init(void) |
1968 | { | 1970 | { |
1969 | int retval; | 1971 | int retval; |
1970 | 1972 | ||
1971 | dbg("%s\n", __func__); | 1973 | dbg("%s\n", __func__); |
1972 | 1974 | ||
1973 | /* register with usb-serial */ | 1975 | retval = usb_serial_register_drivers(&quausb2_usb_driver, |
1974 | retval = usb_serial_register(&quatech2_device); | 1976 | serial_drivers); |
1975 | |||
1976 | if (retval) | ||
1977 | goto failed_usb_serial_register; | ||
1978 | |||
1979 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
1980 | DRIVER_DESC "\n"); | ||
1981 | |||
1982 | /* register with usb */ | ||
1983 | |||
1984 | retval = usb_register(&quausb2_usb_driver); | ||
1985 | if (retval == 0) | 1977 | if (retval == 0) |
1986 | return 0; | 1978 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
1987 | 1979 | DRIVER_DESC "\n"); | |
1988 | /* if we're here, usb_register() failed */ | 1980 | return retval; |
1989 | usb_serial_deregister(&quatech2_device); | ||
1990 | failed_usb_serial_register: | ||
1991 | return retval; | ||
1992 | } | 1981 | } |
1993 | 1982 | ||
1994 | static void __exit quausb2_usb_exit(void) | 1983 | static void __exit quausb2_usb_exit(void) |
1995 | { | 1984 | { |
1996 | usb_deregister(&quausb2_usb_driver); | 1985 | usb_serial_deregister_drivers(&quausb2_usb_driver, serial_drivers); |
1997 | usb_serial_deregister(&quatech2_device); | ||
1998 | } | 1986 | } |
1999 | 1987 | ||
2000 | module_init(quausb2_usb_init); | 1988 | module_init(quausb2_usb_init); |
diff --git a/drivers/staging/serqt_usb2/serqt_usb2.c b/drivers/staging/serqt_usb2/serqt_usb2.c index 1c5780f1571b..04b6be86df1a 100644 --- a/drivers/staging/serqt_usb2/serqt_usb2.c +++ b/drivers/staging/serqt_usb2/serqt_usb2.c | |||
@@ -200,7 +200,6 @@ static struct usb_driver serqt_usb_driver = { | |||
200 | .probe = usb_serial_probe, | 200 | .probe = usb_serial_probe, |
201 | .disconnect = usb_serial_disconnect, | 201 | .disconnect = usb_serial_disconnect, |
202 | .id_table = serqt_id_table, | 202 | .id_table = serqt_id_table, |
203 | .no_dynamic_id = 1, | ||
204 | }; | 203 | }; |
205 | 204 | ||
206 | static int port_paranoia_check(struct usb_serial_port *port, | 205 | static int port_paranoia_check(struct usb_serial_port *port, |
@@ -1590,7 +1589,6 @@ static struct usb_serial_driver quatech_device = { | |||
1590 | .name = "serqt", | 1589 | .name = "serqt", |
1591 | }, | 1590 | }, |
1592 | .description = DRIVER_DESC, | 1591 | .description = DRIVER_DESC, |
1593 | .usb_driver = &serqt_usb_driver, | ||
1594 | .id_table = serqt_id_table, | 1592 | .id_table = serqt_id_table, |
1595 | .num_ports = 8, | 1593 | .num_ports = 8, |
1596 | .open = qt_open, | 1594 | .open = qt_open, |
@@ -1610,37 +1608,27 @@ static struct usb_serial_driver quatech_device = { | |||
1610 | .release = qt_release, | 1608 | .release = qt_release, |
1611 | }; | 1609 | }; |
1612 | 1610 | ||
1611 | static struct usb_serial_driver * const serial_drivers[] = { | ||
1612 | &quatech_device, NULL | ||
1613 | }; | ||
1614 | |||
1613 | static int __init serqt_usb_init(void) | 1615 | static int __init serqt_usb_init(void) |
1614 | { | 1616 | { |
1615 | int retval; | 1617 | int retval; |
1616 | 1618 | ||
1617 | dbg("%s\n", __func__); | 1619 | dbg("%s\n", __func__); |
1618 | 1620 | ||
1619 | /* register with usb-serial */ | 1621 | retval = usb_serial_register_drivers(&serqt_usb_driver, |
1620 | retval = usb_serial_register(&quatech_device); | 1622 | serial_drivers); |
1621 | |||
1622 | if (retval) | ||
1623 | goto failed_usb_serial_register; | ||
1624 | |||
1625 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" | ||
1626 | DRIVER_DESC "\n"); | ||
1627 | |||
1628 | /* register with usb */ | ||
1629 | |||
1630 | retval = usb_register(&serqt_usb_driver); | ||
1631 | if (retval == 0) | 1623 | if (retval == 0) |
1632 | return 0; | 1624 | printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" |
1633 | 1625 | DRIVER_DESC "\n"); | |
1634 | /* if we're here, usb_register() failed */ | ||
1635 | usb_serial_deregister(&quatech_device); | ||
1636 | failed_usb_serial_register: | ||
1637 | return retval; | 1626 | return retval; |
1638 | } | 1627 | } |
1639 | 1628 | ||
1640 | static void __exit serqt_usb_exit(void) | 1629 | static void __exit serqt_usb_exit(void) |
1641 | { | 1630 | { |
1642 | usb_deregister(&serqt_usb_driver); | 1631 | usb_serial_deregister_drivers(&serqt_usb_driver, serial_drivers); |
1643 | usb_serial_deregister(&quatech_device); | ||
1644 | } | 1632 | } |
1645 | 1633 | ||
1646 | module_init(serqt_usb_init); | 1634 | module_init(serqt_usb_init); |