Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185377
b: refs/heads/master
c: f10718f
h: refs/heads/master
i:
  185375: 2b4f3bd
v: v3
  • Loading branch information
Dan Carpenter authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 63bde4e commit 87b43c0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 40 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: 5b520259ab6d661b8d5eb39dd17cc5e4e4553c62
refs/heads/master: f10718f5b812a2c55e37396518d426f88d5e35fc
43 changes: 4 additions & 39 deletions trunk/drivers/usb/serial/io_edgeport.c
Original file line number Diff line number Diff line change
Expand Up @@ -364,43 +364,6 @@ static void update_edgeport_E2PROM(struct edgeport_serial *edge_serial)
release_firmware(fw);
}


/************************************************************************
* *
* Get string descriptor from device *
* *
************************************************************************/
static int get_string(struct usb_device *dev, int Id, char *string, int buflen)
{
struct usb_string_descriptor *StringDesc = NULL;
struct usb_string_descriptor *pStringDesc = NULL;
int ret = 0;

dbg("%s - USB String ID = %d", __func__, Id);

StringDesc = kmalloc(sizeof(*StringDesc), GFP_KERNEL);
if (!StringDesc)
goto free;
if (usb_get_descriptor(dev, USB_DT_STRING, Id, StringDesc, sizeof(*StringDesc)) <= 0)
goto free;

pStringDesc = kmalloc(StringDesc->bLength, GFP_KERNEL);
if (!pStringDesc)
goto free;

if (usb_get_descriptor(dev, USB_DT_STRING, Id, pStringDesc, StringDesc->bLength) <= 0)
goto free;

unicode_to_ascii(string, buflen, pStringDesc->wData, pStringDesc->bLength/2);
ret = strlen(string);
dbg("%s - USB String %s", __func__, string);
free:
kfree(StringDesc);
kfree(pStringDesc);
return ret;
}


#if 0
/************************************************************************
*
Expand Down Expand Up @@ -2998,10 +2961,12 @@ static int edge_startup(struct usb_serial *serial)
usb_set_serial_data(serial, edge_serial);

/* get the name for the device from the device */
i = get_string(dev, dev->descriptor.iManufacturer,
i = usb_string(dev, dev->descriptor.iManufacturer,
&edge_serial->name[0], MAX_NAME_LEN+1);
if (i < 0)
i = 0;
edge_serial->name[i++] = ' ';
get_string(dev, dev->descriptor.iProduct,
usb_string(dev, dev->descriptor.iProduct,
&edge_serial->name[i], MAX_NAME_LEN+2 - i);

dev_info(&serial->dev->dev, "%s detected\n", edge_serial->name);
Expand Down

0 comments on commit 87b43c0

Please sign in to comment.