diff options
author | Johan Hovold <jhovold@gmail.com> | 2010-05-15 11:53:51 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-05-20 16:21:48 -0400 |
commit | 726ef428af41b1fbdf569772ab73de0844c4e0f2 (patch) | |
tree | 2b7a44f25225d1f92c7e000df43aabe4b2cf0fe6 /drivers | |
parent | a90131763dfd9a95f43071f0b67a737e6ca6a6c0 (diff) |
USB: belkin_sa: minor clean-ups
Remove some whitepace and comments.
Clean up close.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/serial/belkin_sa.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c index bdab31afc37..9dbb07ea76e 100644 --- a/drivers/usb/serial/belkin_sa.c +++ b/drivers/usb/serial/belkin_sa.c | |||
@@ -112,7 +112,6 @@ static const struct usb_device_id id_table_combined[] = { | |||
112 | { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) }, | 112 | { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) }, |
113 | { } /* Terminating entry */ | 113 | { } /* Terminating entry */ |
114 | }; | 114 | }; |
115 | |||
116 | MODULE_DEVICE_TABLE(usb, id_table_combined); | 115 | MODULE_DEVICE_TABLE(usb, id_table_combined); |
117 | 116 | ||
118 | static struct usb_driver belkin_driver = { | 117 | static struct usb_driver belkin_driver = { |
@@ -120,7 +119,7 @@ static struct usb_driver belkin_driver = { | |||
120 | .probe = usb_serial_probe, | 119 | .probe = usb_serial_probe, |
121 | .disconnect = usb_serial_disconnect, | 120 | .disconnect = usb_serial_disconnect, |
122 | .id_table = id_table_combined, | 121 | .id_table = id_table_combined, |
123 | .no_dynamic_id = 1, | 122 | .no_dynamic_id = 1, |
124 | }; | 123 | }; |
125 | 124 | ||
126 | /* All of the device info needed for the serial converters */ | 125 | /* All of the device info needed for the serial converters */ |
@@ -145,7 +144,6 @@ static struct usb_serial_driver belkin_device = { | |||
145 | .release = belkin_sa_release, | 144 | .release = belkin_sa_release, |
146 | }; | 145 | }; |
147 | 146 | ||
148 | |||
149 | struct belkin_sa_private { | 147 | struct belkin_sa_private { |
150 | spinlock_t lock; | 148 | spinlock_t lock; |
151 | unsigned long control_state; | 149 | unsigned long control_state; |
@@ -196,23 +194,17 @@ static int belkin_sa_startup(struct usb_serial *serial) | |||
196 | return 0; | 194 | return 0; |
197 | } | 195 | } |
198 | 196 | ||
199 | |||
200 | static void belkin_sa_release(struct usb_serial *serial) | 197 | static void belkin_sa_release(struct usb_serial *serial) |
201 | { | 198 | { |
202 | struct belkin_sa_private *priv; | ||
203 | int i; | 199 | int i; |
204 | 200 | ||
205 | dbg("%s", __func__); | 201 | dbg("%s", __func__); |
206 | 202 | ||
207 | for (i = 0; i < serial->num_ports; ++i) { | 203 | for (i = 0; i < serial->num_ports; ++i) |
208 | /* My special items, the standard routines free my urbs */ | 204 | kfree(usb_get_serial_port_data(serial->port[i])); |
209 | priv = usb_get_serial_port_data(serial->port[i]); | ||
210 | kfree(priv); | ||
211 | } | ||
212 | } | 205 | } |
213 | 206 | ||
214 | 207 | static int belkin_sa_open(struct tty_struct *tty, | |
215 | static int belkin_sa_open(struct tty_struct *tty, | ||
216 | struct usb_serial_port *port) | 208 | struct usb_serial_port *port) |
217 | { | 209 | { |
218 | int retval = 0; | 210 | int retval = 0; |
@@ -239,8 +231,7 @@ static int belkin_sa_open(struct tty_struct *tty, | |||
239 | 231 | ||
240 | exit: | 232 | exit: |
241 | return retval; | 233 | return retval; |
242 | } /* belkin_sa_open */ | 234 | } |
243 | |||
244 | 235 | ||
245 | static void belkin_sa_close(struct usb_serial_port *port) | 236 | static void belkin_sa_close(struct usb_serial_port *port) |
246 | { | 237 | { |
@@ -248,8 +239,7 @@ static void belkin_sa_close(struct usb_serial_port *port) | |||
248 | 239 | ||
249 | usb_serial_generic_close(port); | 240 | usb_serial_generic_close(port); |
250 | usb_kill_urb(port->interrupt_in_urb); | 241 | usb_kill_urb(port->interrupt_in_urb); |
251 | } /* belkin_sa_close */ | 242 | } |
252 | |||
253 | 243 | ||
254 | static void belkin_sa_read_int_callback(struct urb *urb) | 244 | static void belkin_sa_read_int_callback(struct urb *urb) |
255 | { | 245 | { |
@@ -480,8 +470,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty, | |||
480 | spin_lock_irqsave(&priv->lock, flags); | 470 | spin_lock_irqsave(&priv->lock, flags); |
481 | priv->control_state = control_state; | 471 | priv->control_state = control_state; |
482 | spin_unlock_irqrestore(&priv->lock, flags); | 472 | spin_unlock_irqrestore(&priv->lock, flags); |
483 | } /* belkin_sa_set_termios */ | 473 | } |
484 | |||
485 | 474 | ||
486 | static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state) | 475 | static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state) |
487 | { | 476 | { |
@@ -492,7 +481,6 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state) | |||
492 | dev_err(&port->dev, "Set break_ctl %d\n", break_state); | 481 | dev_err(&port->dev, "Set break_ctl %d\n", break_state); |
493 | } | 482 | } |
494 | 483 | ||
495 | |||
496 | static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file) | 484 | static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file) |
497 | { | 485 | { |
498 | struct usb_serial_port *port = tty->driver_data; | 486 | struct usb_serial_port *port = tty->driver_data; |
@@ -509,7 +497,6 @@ static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file) | |||
509 | return control_state; | 497 | return control_state; |
510 | } | 498 | } |
511 | 499 | ||
512 | |||
513 | static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, | 500 | static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file, |
514 | unsigned int set, unsigned int clear) | 501 | unsigned int set, unsigned int clear) |
515 | { | 502 | { |
@@ -581,7 +568,6 @@ failed_usb_serial_register: | |||
581 | return retval; | 568 | return retval; |
582 | } | 569 | } |
583 | 570 | ||
584 | |||
585 | static void __exit belkin_sa_exit (void) | 571 | static void __exit belkin_sa_exit (void) |
586 | { | 572 | { |
587 | usb_deregister(&belkin_driver); | 573 | usb_deregister(&belkin_driver); |