Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250181
b: refs/heads/master
c: b47b850
h: refs/heads/master
i:
  250179: 19943b2
v: v3
  • Loading branch information
Florian Mickler authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent ab996e3 commit 8883fe5
Show file tree
Hide file tree
Showing 2 changed files with 9 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: 0e4e7208e6b33816c457292ee771da3a5779027b
refs/heads/master: b47b850116369a474f71c8ee1e7d06dfa9bf5468
10 changes: 8 additions & 2 deletions trunk/drivers/media/dvb/dvb-usb/dw2102.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,25 @@ static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
u16 index, u8 * data, u16 len, int flags)
{
int ret;
u8 u8buf[len];

u8 *u8buf;
unsigned int pipe = (flags == DW210X_READ_MSG) ?
usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;

u8buf = kmalloc(len, GFP_KERNEL);
if (!u8buf)
return -ENOMEM;


if (flags == DW210X_WRITE_MSG)
memcpy(u8buf, data, len);
ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
value, index , u8buf, len, 2000);

if (flags == DW210X_READ_MSG)
memcpy(data, u8buf, len);

kfree(u8buf);
return ret;
}

Expand Down

0 comments on commit 8883fe5

Please sign in to comment.