Skip to content

Commit 726ef42

Browse files
jhovoldgregkh
authored andcommitted
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>
1 parent a901317 commit 726ef42

1 file changed

Lines changed: 7 additions & 21 deletions

File tree

‎drivers/usb/serial/belkin_sa.c‎

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,14 @@ static const struct usb_device_id id_table_combined[] = {
112112
{ USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) },
113113
{ } /* Terminating entry */
114114
};
115-
116115
MODULE_DEVICE_TABLE(usb, id_table_combined);
117116

118117
static struct usb_driver belkin_driver = {
119118
.name = "belkin",
120119
.probe = usb_serial_probe,
121120
.disconnect = usb_serial_disconnect,
122121
.id_table = id_table_combined,
123-
.no_dynamic_id = 1,
122+
.no_dynamic_id = 1,
124123
};
125124

126125
/* All of the device info needed for the serial converters */
@@ -145,7 +144,6 @@ static struct usb_serial_driver belkin_device = {
145144
.release = belkin_sa_release,
146145
};
147146

148-
149147
struct belkin_sa_private {
150148
spinlock_t lock;
151149
unsigned long control_state;
@@ -196,23 +194,17 @@ static int belkin_sa_startup(struct usb_serial *serial)
196194
return 0;
197195
}
198196

199-
200197
static void belkin_sa_release(struct usb_serial *serial)
201198
{
202-
struct belkin_sa_private *priv;
203199
int i;
204200

205201
dbg("%s", __func__);
206202

207-
for (i = 0; i < serial->num_ports; ++i) {
208-
/* My special items, the standard routines free my urbs */
209-
priv = usb_get_serial_port_data(serial->port[i]);
210-
kfree(priv);
211-
}
203+
for (i = 0; i < serial->num_ports; ++i)
204+
kfree(usb_get_serial_port_data(serial->port[i]));
212205
}
213206

214-
215-
static int belkin_sa_open(struct tty_struct *tty,
207+
static int belkin_sa_open(struct tty_struct *tty,
216208
struct usb_serial_port *port)
217209
{
218210
int retval = 0;
@@ -239,17 +231,15 @@ static int belkin_sa_open(struct tty_struct *tty,
239231

240232
exit:
241233
return retval;
242-
} /* belkin_sa_open */
243-
234+
}
244235

245236
static void belkin_sa_close(struct usb_serial_port *port)
246237
{
247238
dbg("%s port %d", __func__, port->number);
248239

249240
usb_serial_generic_close(port);
250241
usb_kill_urb(port->interrupt_in_urb);
251-
} /* belkin_sa_close */
252-
242+
}
253243

254244
static void belkin_sa_read_int_callback(struct urb *urb)
255245
{
@@ -480,8 +470,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
480470
spin_lock_irqsave(&priv->lock, flags);
481471
priv->control_state = control_state;
482472
spin_unlock_irqrestore(&priv->lock, flags);
483-
} /* belkin_sa_set_termios */
484-
473+
}
485474

486475
static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
487476
{
@@ -492,7 +481,6 @@ static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
492481
dev_err(&port->dev, "Set break_ctl %d\n", break_state);
493482
}
494483

495-
496484
static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
497485
{
498486
struct usb_serial_port *port = tty->driver_data;
@@ -509,7 +497,6 @@ static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
509497
return control_state;
510498
}
511499

512-
513500
static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
514501
unsigned int set, unsigned int clear)
515502
{
@@ -581,7 +568,6 @@ static int __init belkin_sa_init(void)
581568
return retval;
582569
}
583570

584-
585571
static void __exit belkin_sa_exit (void)
586572
{
587573
usb_deregister(&belkin_driver);

0 commit comments

Comments
 (0)