Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334546
b: refs/heads/master
c: 638b9e1
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 17, 2012
1 parent dac9341 commit 8cb92fd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 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: 51ef847df74632e7cfdf952afc3887de105b8b35
refs/heads/master: 638b9e15233c9570bce65301aa9877235316b9f0
34 changes: 20 additions & 14 deletions trunk/drivers/usb/serial/ssu100.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@ struct ssu100_port_private {
struct async_icount icount;
};

static void ssu100_release(struct usb_serial *serial)
{
struct ssu100_port_private *priv = usb_get_serial_port_data(*serial->port);

kfree(priv);
}

static inline int ssu100_control_msg(struct usb_device *dev,
u8 request, u16 data, u16 index)
{
Expand Down Expand Up @@ -441,22 +434,34 @@ static int ssu100_ioctl(struct tty_struct *tty,
}

static int ssu100_attach(struct usb_serial *serial)
{
return ssu100_initdevice(serial->dev);
}

static int ssu100_port_probe(struct usb_serial_port *port)
{
struct ssu100_port_private *priv;
struct usb_serial_port *port = *serial->port;

priv = kzalloc(sizeof(*priv), GFP_KERNEL);
if (!priv) {
dev_err(&port->dev, "%s- kmalloc(%Zd) failed.\n", __func__,
sizeof(*priv));
if (!priv)
return -ENOMEM;
}

spin_lock_init(&priv->status_lock);
init_waitqueue_head(&priv->delta_msr_wait);

usb_set_serial_port_data(port, priv);

return ssu100_initdevice(serial->dev);
return 0;
}

static int ssu100_port_remove(struct usb_serial_port *port)
{
struct ssu100_port_private *priv;

priv = usb_get_serial_port_data(port);
kfree(priv);

return 0;
}

static int ssu100_tiocmget(struct tty_struct *tty)
Expand Down Expand Up @@ -647,7 +652,8 @@ static struct usb_serial_driver ssu100_device = {
.open = ssu100_open,
.close = ssu100_close,
.attach = ssu100_attach,
.release = ssu100_release,
.port_probe = ssu100_port_probe,
.port_remove = ssu100_port_remove,
.dtr_rts = ssu100_dtr_rts,
.process_read_urb = ssu100_process_read_urb,
.tiocmget = ssu100_tiocmget,
Expand Down

0 comments on commit 8cb92fd

Please sign in to comment.