diff options
Diffstat (limited to 'drivers/usb/serial/oti6858.c')
-rw-r--r-- | drivers/usb/serial/oti6858.c | 36 |
1 files changed, 8 insertions, 28 deletions
diff --git a/drivers/usb/serial/oti6858.c b/drivers/usb/serial/oti6858.c index e287fd32682c..5fdc33c6a3c0 100644 --- a/drivers/usb/serial/oti6858.c +++ b/drivers/usb/serial/oti6858.c | |||
@@ -71,7 +71,6 @@ static struct usb_driver oti6858_driver = { | |||
71 | .probe = usb_serial_probe, | 71 | .probe = usb_serial_probe, |
72 | .disconnect = usb_serial_disconnect, | 72 | .disconnect = usb_serial_disconnect, |
73 | .id_table = id_table, | 73 | .id_table = id_table, |
74 | .no_dynamic_id = 1, | ||
75 | }; | 74 | }; |
76 | 75 | ||
77 | static bool debug; | 76 | static bool debug; |
@@ -157,7 +156,6 @@ static struct usb_serial_driver oti6858_device = { | |||
157 | .name = "oti6858", | 156 | .name = "oti6858", |
158 | }, | 157 | }, |
159 | .id_table = id_table, | 158 | .id_table = id_table, |
160 | .usb_driver = &oti6858_driver, | ||
161 | .num_ports = 1, | 159 | .num_ports = 1, |
162 | .open = oti6858_open, | 160 | .open = oti6858_open, |
163 | .close = oti6858_close, | 161 | .close = oti6858_close, |
@@ -176,6 +174,10 @@ static struct usb_serial_driver oti6858_device = { | |||
176 | .release = oti6858_release, | 174 | .release = oti6858_release, |
177 | }; | 175 | }; |
178 | 176 | ||
177 | static struct usb_serial_driver * const serial_drivers[] = { | ||
178 | &oti6858_device, NULL | ||
179 | }; | ||
180 | |||
179 | struct oti6858_private { | 181 | struct oti6858_private { |
180 | spinlock_t lock; | 182 | spinlock_t lock; |
181 | 183 | ||
@@ -302,7 +304,7 @@ static void send_data(struct work_struct *work) | |||
302 | if (count != 0) { | 304 | if (count != 0) { |
303 | allow = kmalloc(1, GFP_KERNEL); | 305 | allow = kmalloc(1, GFP_KERNEL); |
304 | if (!allow) { | 306 | if (!allow) { |
305 | dev_err(&port->dev, "%s(): kmalloc failed\n", | 307 | dev_err_console(port, "%s(): kmalloc failed\n", |
306 | __func__); | 308 | __func__); |
307 | return; | 309 | return; |
308 | } | 310 | } |
@@ -334,7 +336,7 @@ static void send_data(struct work_struct *work) | |||
334 | port->write_urb->transfer_buffer_length = count; | 336 | port->write_urb->transfer_buffer_length = count; |
335 | result = usb_submit_urb(port->write_urb, GFP_NOIO); | 337 | result = usb_submit_urb(port->write_urb, GFP_NOIO); |
336 | if (result != 0) { | 338 | if (result != 0) { |
337 | dev_err(&port->dev, "%s(): usb_submit_urb() failed" | 339 | dev_err_console(port, "%s(): usb_submit_urb() failed" |
338 | " with error %d\n", __func__, result); | 340 | " with error %d\n", __func__, result); |
339 | priv->flags.write_urb_in_use = 0; | 341 | priv->flags.write_urb_in_use = 0; |
340 | } | 342 | } |
@@ -938,7 +940,7 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
938 | port->write_urb->transfer_buffer_length = 1; | 940 | port->write_urb->transfer_buffer_length = 1; |
939 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); | 941 | result = usb_submit_urb(port->write_urb, GFP_ATOMIC); |
940 | if (result) { | 942 | if (result) { |
941 | dev_err(&port->dev, "%s(): usb_submit_urb() failed," | 943 | dev_err_console(port, "%s(): usb_submit_urb() failed," |
942 | " error %d\n", __func__, result); | 944 | " error %d\n", __func__, result); |
943 | } else { | 945 | } else { |
944 | return; | 946 | return; |
@@ -956,29 +958,7 @@ static void oti6858_write_bulk_callback(struct urb *urb) | |||
956 | } | 958 | } |
957 | } | 959 | } |
958 | 960 | ||
959 | /* module description and (de)initialization */ | 961 | module_usb_serial_driver(oti6858_driver, serial_drivers); |
960 | |||
961 | static int __init oti6858_init(void) | ||
962 | { | ||
963 | int retval; | ||
964 | |||
965 | retval = usb_serial_register(&oti6858_device); | ||
966 | if (retval == 0) { | ||
967 | retval = usb_register(&oti6858_driver); | ||
968 | if (retval) | ||
969 | usb_serial_deregister(&oti6858_device); | ||
970 | } | ||
971 | return retval; | ||
972 | } | ||
973 | |||
974 | static void __exit oti6858_exit(void) | ||
975 | { | ||
976 | usb_deregister(&oti6858_driver); | ||
977 | usb_serial_deregister(&oti6858_device); | ||
978 | } | ||
979 | |||
980 | module_init(oti6858_init); | ||
981 | module_exit(oti6858_exit); | ||
982 | 962 | ||
983 | MODULE_DESCRIPTION(OTI6858_DESCRIPTION); | 963 | MODULE_DESCRIPTION(OTI6858_DESCRIPTION); |
984 | MODULE_AUTHOR(OTI6858_AUTHOR); | 964 | MODULE_AUTHOR(OTI6858_AUTHOR); |