Skip to content

Commit

Permalink
USB: belkin_sa: minor clean-ups
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed May 20, 2010
1 parent a901317 commit 726ef42
Showing 1 changed file with 7 additions and 21 deletions.
28 changes: 7 additions & 21 deletions drivers/usb/serial/belkin_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,14 @@ static const struct usb_device_id id_table_combined[] = {
{ USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) },
{ } /* Terminating entry */
};

MODULE_DEVICE_TABLE(usb, id_table_combined);

static struct usb_driver belkin_driver = {
.name = "belkin",
.probe = usb_serial_probe,
.disconnect = usb_serial_disconnect,
.id_table = id_table_combined,
.no_dynamic_id = 1,
.no_dynamic_id = 1,
};

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


struct belkin_sa_private {
spinlock_t lock;
unsigned long control_state;
Expand Down Expand Up @@ -196,23 +194,17 @@ static int belkin_sa_startup(struct usb_serial *serial)
return 0;
}


static void belkin_sa_release(struct usb_serial *serial)
{
struct belkin_sa_private *priv;
int i;

dbg("%s", __func__);

for (i = 0; i < serial->num_ports; ++i) {
/* My special items, the standard routines free my urbs */
priv = usb_get_serial_port_data(serial->port[i]);
kfree(priv);
}
for (i = 0; i < serial->num_ports; ++i)
kfree(usb_get_serial_port_data(serial->port[i]));
}


static int belkin_sa_open(struct tty_struct *tty,
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port)
{
int retval = 0;
Expand All @@ -239,17 +231,15 @@ static int belkin_sa_open(struct tty_struct *tty,

exit:
return retval;
} /* belkin_sa_open */

}

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

usb_serial_generic_close(port);
usb_kill_urb(port->interrupt_in_urb);
} /* belkin_sa_close */

}

static void belkin_sa_read_int_callback(struct urb *urb)
{
Expand Down Expand Up @@ -480,8 +470,7 @@ static void belkin_sa_set_termios(struct tty_struct *tty,
spin_lock_irqsave(&priv->lock, flags);
priv->control_state = control_state;
spin_unlock_irqrestore(&priv->lock, flags);
} /* belkin_sa_set_termios */

}

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


static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
{
struct usb_serial_port *port = tty->driver_data;
Expand All @@ -509,7 +497,6 @@ static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
return control_state;
}


static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
unsigned int set, unsigned int clear)
{
Expand Down Expand Up @@ -581,7 +568,6 @@ static int __init belkin_sa_init(void)
return retval;
}


static void __exit belkin_sa_exit (void)
{
usb_deregister(&belkin_driver);
Expand Down

0 comments on commit 726ef42

Please sign in to comment.