Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 334548
b: refs/heads/master
c: 0978c94
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Oct 18, 2012
1 parent 834bc98 commit ab9ff36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: bf90ff5f3b8f67e5b42df4ea4fd543f8010a2676
refs/heads/master: 0978c9499944d0670338fd048a3bdb1624dc66dc
14 changes: 12 additions & 2 deletions trunk/drivers/usb/serial/iuu_phoenix.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ static int iuu_cardout;
static bool xmas;
static int vcc_default = 5;

static int iuu_create_sysfs_attrs(struct usb_serial_port *port);
static int iuu_remove_sysfs_attrs(struct usb_serial_port *port);
static void read_rxcmd_callback(struct urb *urb);

struct iuu_private {
Expand All @@ -75,6 +77,7 @@ struct iuu_private {
static int iuu_port_probe(struct usb_serial_port *port)
{
struct iuu_private *priv;
int ret;

priv = kzalloc(sizeof(struct iuu_private), GFP_KERNEL);
if (!priv)
Expand All @@ -99,13 +102,22 @@ static int iuu_port_probe(struct usb_serial_port *port)

usb_set_serial_port_data(port, priv);

ret = iuu_create_sysfs_attrs(port);
if (ret) {
kfree(priv->writebuf);
kfree(priv->buf);
kfree(priv);
return ret;
}

return 0;
}

static int iuu_port_remove(struct usb_serial_port *port)
{
struct iuu_private *priv = usb_get_serial_port_data(port);

iuu_remove_sysfs_attrs(port);
kfree(priv->writebuf);
kfree(priv->buf);
kfree(priv);
Expand Down Expand Up @@ -1197,8 +1209,6 @@ static struct usb_serial_driver iuu_device = {
.num_ports = 1,
.bulk_in_size = 512,
.bulk_out_size = 512,
.port_probe = iuu_create_sysfs_attrs,
.port_remove = iuu_remove_sysfs_attrs,
.open = iuu_open,
.close = iuu_close,
.write = iuu_uart_write,
Expand Down

0 comments on commit ab9ff36

Please sign in to comment.