Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185304
b: refs/heads/master
c: 401711c
h: refs/heads/master
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 5cb7941 commit a3be1a6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 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: d2126326bd71b56fcaa5e86474433d11e253f84d
refs/heads/master: 401711cb575bbbdb100bc1a14cb2024dfc9b4869
26 changes: 18 additions & 8 deletions trunk/drivers/usb/serial/visor.c
Original file line number Diff line number Diff line change
Expand Up @@ -807,47 +807,57 @@ static int clie_3_5_startup(struct usb_serial *serial)
{
struct device *dev = &serial->dev->dev;
int result;
u8 data;
u8 *data;

dbg("%s", __func__);

data = kmalloc(1, GFP_KERNEL);
if (!data)
return -ENOMEM;

/*
* Note that PEG-300 series devices expect the following two calls.
*/

/* get the config number */
result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
USB_REQ_GET_CONFIGURATION, USB_DIR_IN,
0, 0, &data, 1, 3000);
0, 0, data, 1, 3000);
if (result < 0) {
dev_err(dev, "%s: get config number failed: %d\n",
__func__, result);
return result;
goto out;
}
if (result != 1) {
dev_err(dev, "%s: get config number bad return length: %d\n",
__func__, result);
return -EIO;
result = -EIO;
goto out;
}

/* get the interface number */
result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
USB_REQ_GET_INTERFACE,
USB_DIR_IN | USB_RECIP_INTERFACE,
0, 0, &data, 1, 3000);
0, 0, data, 1, 3000);
if (result < 0) {
dev_err(dev, "%s: get interface number failed: %d\n",
__func__, result);
return result;
goto out;
}
if (result != 1) {
dev_err(dev,
"%s: get interface number bad return length: %d\n",
__func__, result);
return -EIO;
result = -EIO;
goto out;
}

return generic_startup(serial);
result = generic_startup(serial);
out:
kfree(data);

return result;
}

static int treo_attach(struct usb_serial *serial)
Expand Down

0 comments on commit a3be1a6

Please sign in to comment.