Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334526
b: refs/heads/master
c: fa91975
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 16, 2012
1 parent 820f5a4 commit 1490b25
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a9556040119a63d06fd5238d47f5b683fba4178b
refs/heads/master: fa919751a2d26a88140fc5810124dd81644efe51
31 changes: 15 additions & 16 deletions trunk/drivers/usb/serial/belkin_sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
#define DRIVER_DESC "USB Belkin Serial converter driver"

/* function prototypes for a Belkin USB Serial Adapter F5U103 */
static int belkin_sa_startup(struct usb_serial *serial);
static void belkin_sa_release(struct usb_serial *serial);
static int belkin_sa_port_probe(struct usb_serial_port *port);
static int belkin_sa_port_remove(struct usb_serial_port *port);
static int belkin_sa_open(struct tty_struct *tty,
struct usb_serial_port *port);
static void belkin_sa_close(struct usb_serial_port *port);
Expand Down Expand Up @@ -88,8 +88,8 @@ static struct usb_serial_driver belkin_device = {
.break_ctl = belkin_sa_break_ctl,
.tiocmget = belkin_sa_tiocmget,
.tiocmset = belkin_sa_tiocmset,
.attach = belkin_sa_startup,
.release = belkin_sa_release,
.port_probe = belkin_sa_port_probe,
.port_remove = belkin_sa_port_remove,
};

static struct usb_serial_driver * const serial_drivers[] = {
Expand Down Expand Up @@ -118,17 +118,15 @@ struct belkin_sa_private {
(c), BELKIN_SA_SET_REQUEST_TYPE, \
(v), 0, NULL, 0, WDR_TIMEOUT)

/* do some startup allocations not currently performed by usb_serial_probe() */
static int belkin_sa_startup(struct usb_serial *serial)
static int belkin_sa_port_probe(struct usb_serial_port *port)
{
struct usb_device *dev = serial->dev;
struct usb_device *dev = port->serial->dev;
struct belkin_sa_private *priv;

/* allocate the private data structure */
priv = kmalloc(sizeof(struct belkin_sa_private), GFP_KERNEL);
if (!priv)
return -1; /* error */
/* set initial values for control structures */
return -ENOMEM;

spin_lock_init(&priv->lock);
priv->control_state = 0;
priv->last_lsr = 0;
Expand All @@ -140,18 +138,19 @@ static int belkin_sa_startup(struct usb_serial *serial)
le16_to_cpu(dev->descriptor.bcdDevice),
priv->bad_flow_control);

init_waitqueue_head(&serial->port[0]->write_wait);
usb_set_serial_port_data(serial->port[0], priv);
usb_set_serial_port_data(port, priv);

return 0;
}

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

for (i = 0; i < serial->num_ports; ++i)
kfree(usb_get_serial_port_data(serial->port[i]));
priv = usb_get_serial_port_data(port);
kfree(priv);

return 0;
}

static int belkin_sa_open(struct tty_struct *tty,
Expand Down

0 comments on commit 1490b25

Please sign in to comment.