Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250189
b: refs/heads/master
c: 9a187c4
h: refs/heads/master
i:
  250187: d50878e
v: v3
  • Loading branch information
Florian Mickler authored and Mauro Carvalho Chehab committed May 20, 2011
1 parent 5ca91ad commit f3fcd4d
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 8 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: 57873c720caddf19eef2d5fe734575f7175abb48
refs/heads/master: 9a187c4183edb6e705245c0fb2439aa3e8dce1fe
37 changes: 30 additions & 7 deletions trunk/drivers/media/dvb/dvb-usb/vp702x.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ struct vp702x_adapter_state {
u8 pid_filter_state;
};

/* check for mutex FIXME */
int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8 *b, int blen)
static int vp702x_usb_in_op_unlocked(struct dvb_usb_device *d, u8 req,
u16 value, u16 index, u8 *b, int blen)
{
int ret;

Expand All @@ -55,8 +55,20 @@ int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8
return ret;
}

static int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
u16 index, u8 *b, int blen)
int vp702x_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value,
u16 index, u8 *b, int blen)
{
int ret;

mutex_lock(&d->usb_mutex);
ret = vp702x_usb_in_op_unlocked(d, req, value, index, b, blen);
mutex_unlock(&d->usb_mutex);

return ret;
}

int vp702x_usb_out_op_unlocked(struct dvb_usb_device *d, u8 req, u16 value,
u16 index, u8 *b, int blen)
{
int ret;
deb_xfer("out: req. %02x, val: %04x, ind: %04x, buffer: ",req,value,index);
Expand All @@ -74,19 +86,30 @@ static int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
return 0;
}

int vp702x_usb_out_op(struct dvb_usb_device *d, u8 req, u16 value,
u16 index, u8 *b, int blen)
{
int ret;

mutex_lock(&d->usb_mutex);
ret = vp702x_usb_out_op_unlocked(d, req, value, index, b, blen);
mutex_unlock(&d->usb_mutex);

return ret;
}

int vp702x_usb_inout_op(struct dvb_usb_device *d, u8 *o, int olen, u8 *i, int ilen, int msec)
{
int ret;

if ((ret = mutex_lock_interruptible(&d->usb_mutex)))
return ret;

ret = vp702x_usb_out_op(d,REQUEST_OUT,0,0,o,olen);
ret = vp702x_usb_out_op_unlocked(d, REQUEST_OUT, 0, 0, o, olen);
msleep(msec);
ret = vp702x_usb_in_op(d,REQUEST_IN,0,0,i,ilen);
ret = vp702x_usb_in_op_unlocked(d, REQUEST_IN, 0, 0, i, ilen);

mutex_unlock(&d->usb_mutex);

return ret;
}

Expand Down

0 comments on commit f3fcd4d

Please sign in to comment.