diff options
author | Alan Stern <stern@rowland.harvard.edu> | 2012-02-23 14:57:25 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-02-24 15:39:20 -0500 |
commit | d860322f34e4a53f347b1aeae23d5b72f1e91b8c (patch) | |
tree | bea8d4ab22b81eed98ab67c82a994b73cb6c5763 /drivers/usb/serial/siemens_mpi.c | |
parent | f667ddad41e303ebc2c6d5bf3105dffe2fbdd717 (diff) |
usb-serial: use new registration API in [q-s]* drivers
This patch (as1528) modifies the following usb-serial drivers to
utilize the new usb_serial_{de}register_drivers() routines:
qcaux, qcserial, safe_serial, siemens_mpi, sierra,
spcp8x5, ssu100, and symbolserial.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/siemens_mpi.c')
-rw-r--r-- | drivers/usb/serial/siemens_mpi.c | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/drivers/usb/serial/siemens_mpi.c b/drivers/usb/serial/siemens_mpi.c index 74cd4ccdb3fc..8aa4c1aef6d1 100644 --- a/drivers/usb/serial/siemens_mpi.c +++ b/drivers/usb/serial/siemens_mpi.c | |||
@@ -42,33 +42,29 @@ static struct usb_serial_driver siemens_usb_mpi_device = { | |||
42 | .name = "siemens_mpi", | 42 | .name = "siemens_mpi", |
43 | }, | 43 | }, |
44 | .id_table = id_table, | 44 | .id_table = id_table, |
45 | .usb_driver = &siemens_usb_mpi_driver, | ||
46 | .num_ports = 1, | 45 | .num_ports = 1, |
47 | }; | 46 | }; |
48 | 47 | ||
48 | static struct usb_serial_driver * const serial_drivers[] = { | ||
49 | &siemens_usb_mpi_device, NULL | ||
50 | }; | ||
51 | |||
49 | static int __init siemens_usb_mpi_init(void) | 52 | static int __init siemens_usb_mpi_init(void) |
50 | { | 53 | { |
51 | int retval; | 54 | int retval; |
52 | 55 | ||
53 | retval = usb_serial_register(&siemens_usb_mpi_device); | 56 | retval = usb_serial_register_drivers(&siemens_usb_mpi_driver, |
54 | if (retval) | 57 | serial_drivers); |
55 | goto failed_usb_serial_register; | 58 | if (retval == 0) { |
56 | retval = usb_register(&siemens_usb_mpi_driver); | 59 | printk(KERN_INFO DRIVER_DESC "\n"); |
57 | if (retval) | 60 | printk(KERN_INFO DRIVER_VERSION " " DRIVER_AUTHOR "\n"); |
58 | goto failed_usb_register; | 61 | } |
59 | printk(KERN_INFO DRIVER_DESC "\n"); | ||
60 | printk(KERN_INFO DRIVER_VERSION " " DRIVER_AUTHOR "\n"); | ||
61 | return retval; | ||
62 | failed_usb_register: | ||
63 | usb_serial_deregister(&siemens_usb_mpi_device); | ||
64 | failed_usb_serial_register: | ||
65 | return retval; | 62 | return retval; |
66 | } | 63 | } |
67 | 64 | ||
68 | static void __exit siemens_usb_mpi_exit(void) | 65 | static void __exit siemens_usb_mpi_exit(void) |
69 | { | 66 | { |
70 | usb_deregister(&siemens_usb_mpi_driver); | 67 | usb_serial_deregister_drivers(&siemens_usb_mpi_driver, serial_drivers); |
71 | usb_serial_deregister(&siemens_usb_mpi_device); | ||
72 | } | 68 | } |
73 | 69 | ||
74 | module_init(siemens_usb_mpi_init); | 70 | module_init(siemens_usb_mpi_init); |