diff options
Diffstat (limited to 'drivers/usb/serial/usb_debug.c')
| -rw-r--r-- | drivers/usb/serial/usb_debug.c | 44 | 
1 files changed, 9 insertions, 35 deletions
diff --git a/drivers/usb/serial/usb_debug.c b/drivers/usb/serial/usb_debug.c index f2ed6a31be7..ca2fa5bbe17 100644 --- a/drivers/usb/serial/usb_debug.c +++ b/drivers/usb/serial/usb_debug.c @@ -10,7 +10,6 @@  #include <linux/gfp.h>  #include <linux/kernel.h> -#include <linux/init.h>  #include <linux/tty.h>  #include <linux/module.h>  #include <linux/usb.h> @@ -35,14 +34,6 @@ static const struct usb_device_id id_table[] = {  };  MODULE_DEVICE_TABLE(usb, id_table); -static struct usb_driver debug_driver = { -	.name =		"debug", -	.probe =	usb_serial_probe, -	.disconnect =	usb_serial_disconnect, -	.id_table =	id_table, -	.no_dynamic_id = 	1, -}; -  /* This HW really does not support a serial break, so one will be   * emulated when ever the break state is set to true.   */ @@ -54,19 +45,18 @@ static void usb_debug_break_ctl(struct tty_struct *tty, int break_state)  	usb_serial_generic_write(tty, port, USB_DEBUG_BRK, USB_DEBUG_BRK_SIZE);  } -static void usb_debug_read_bulk_callback(struct urb *urb) +static void usb_debug_process_read_urb(struct urb *urb)  {  	struct usb_serial_port *port = urb->context;  	if (urb->actual_length == USB_DEBUG_BRK_SIZE && -	    memcmp(urb->transfer_buffer, USB_DEBUG_BRK, -		   USB_DEBUG_BRK_SIZE) == 0) { +		memcmp(urb->transfer_buffer, USB_DEBUG_BRK, +						USB_DEBUG_BRK_SIZE) == 0) {  		usb_serial_handle_break(port); -		usb_serial_generic_submit_read_urb(port, GFP_ATOMIC);  		return;  	} -	usb_serial_generic_read_bulk_callback(urb); +	usb_serial_generic_process_read_urb(urb);  }  static struct usb_serial_driver debug_device = { @@ -78,28 +68,12 @@ static struct usb_serial_driver debug_device = {  	.num_ports =		1,  	.bulk_out_size =	USB_DEBUG_MAX_PACKET_SIZE,  	.break_ctl =		usb_debug_break_ctl, -	.read_bulk_callback =	usb_debug_read_bulk_callback, +	.process_read_urb =	usb_debug_process_read_urb,  }; -static int __init debug_init(void) -{ -	int retval; - -	retval = usb_serial_register(&debug_device); -	if (retval) -		return retval; -	retval = usb_register(&debug_driver); -	if (retval) -		usb_serial_deregister(&debug_device); -	return retval; -} - -static void __exit debug_exit(void) -{ -	usb_deregister(&debug_driver); -	usb_serial_deregister(&debug_device); -} +static struct usb_serial_driver * const serial_drivers[] = { +	&debug_device, NULL +}; -module_init(debug_init); -module_exit(debug_exit); +module_usb_serial_driver(serial_drivers, id_table);  MODULE_LICENSE("GPL");  | 
