Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185301
b: refs/heads/master
c: eb771e2
h: refs/heads/master
i:
  185299: aee9dab
v: v3
  • Loading branch information
Johan Hovold authored and Greg Kroah-Hartman committed Mar 2, 2010
1 parent 0350aa5 commit eec5881
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 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: abf492e7b3ae74873688cf9960283853a3054471
refs/heads/master: eb771e2c6507e0a317e576a3147252ebcb64035a
34 changes: 17 additions & 17 deletions trunk/drivers/usb/serial/mos7720.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,11 @@ static void mos7720_bulk_out_data_callback(struct urb *urb)
* this function will be used for sending command to device
*/
static int send_mos_cmd(struct usb_serial *serial, __u8 request, __u16 value,
__u16 index, void *data)
__u16 index, u8 *data)
{
int status;
unsigned int pipe;
u8 *buf;
u16 product = le16_to_cpu(serial->dev->descriptor.idProduct);
__u8 requesttype;
__u16 size = 0x0000;

if (value < MOS_MAX_PORT) {
if (product == MOSCHIP_DEVICE_ID_7715)
Expand All @@ -298,21 +296,23 @@ static int send_mos_cmd(struct usb_serial *serial, __u8 request, __u16 value,
}

if (request == MOS_WRITE) {
request = (__u8)MOS_WRITE;
requesttype = (__u8)0x40;
value = value + (__u16)*((unsigned char *)data);
data = NULL;
pipe = usb_sndctrlpipe(serial->dev, 0);
value = value + *data;
status = usb_control_msg(serial->dev,
usb_sndctrlpipe(serial->dev, 0), MOS_WRITE,
0x40, value, index, NULL, 0, MOS_WDR_TIMEOUT);
} else {
request = (__u8)MOS_READ;
requesttype = (__u8)0xC0;
size = 0x01;
pipe = usb_rcvctrlpipe(serial->dev, 0);
buf = kmalloc(1, GFP_KERNEL);
if (!buf) {
status = -ENOMEM;
goto out;
}
status = usb_control_msg(serial->dev,
usb_rcvctrlpipe(serial->dev, 0), MOS_READ,
0xc0, value, index, buf, 1, MOS_WDR_TIMEOUT);
*data = *buf;
kfree(buf);
}

status = usb_control_msg(serial->dev, pipe, request, requesttype,
value, index, data, size, MOS_WDR_TIMEOUT);

out:
if (status < 0)
dbg("Command Write failed Value %x index %x\n", value, index);

Expand Down

0 comments on commit eec5881

Please sign in to comment.