Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 72023
b: refs/heads/master
c: 475d526
h: refs/heads/master
i:
  72021: 2f68281
  72019: a55874c
  72015: d052bce
v: v3
  • Loading branch information
Jiri Slaby authored and Mauro Carvalho Chehab committed Oct 22, 2007
1 parent f7ef49c commit 018453a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 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: 3bcc95760c9ee7adb8509173b78914339baa7f4f
refs/heads/master: 475d5263114d55eb9024e6ab4b6ea74e28386970
42 changes: 29 additions & 13 deletions trunk/drivers/media/dvb/cinergyT2/cinergyT2.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,9 @@ static int cinergyt2_start_feed(struct dvb_demux_feed *dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct cinergyt2 *cinergyt2 = demux->priv;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending)
return -EAGAIN;
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;

if (cinergyt2->streaming == 0)
Expand All @@ -361,7 +363,9 @@ static int cinergyt2_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
struct dvb_demux *demux = dvbdmxfeed->demux;
struct cinergyt2 *cinergyt2 = demux->priv;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending)
return -EAGAIN;
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;

if (--cinergyt2->streaming == 0)
Expand Down Expand Up @@ -481,12 +485,16 @@ static int cinergyt2_open (struct inode *inode, struct file *file)
{
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
int err = -ERESTARTSYS;
int err = -EAGAIN;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
if (cinergyt2->disconnect_pending)
goto out;
err = mutex_lock_interruptible(&cinergyt2->wq_sem);
if (err)
goto out;

if (mutex_lock_interruptible(&cinergyt2->sem))
err = mutex_lock_interruptible(&cinergyt2->sem);
if (err)
goto out_unlock1;

if ((err = dvb_generic_open(inode, file)))
Expand Down Expand Up @@ -550,7 +558,9 @@ static unsigned int cinergyt2_poll (struct file *file, struct poll_table_struct
struct cinergyt2 *cinergyt2 = dvbdev->priv;
unsigned int mask = 0;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending)
return -EAGAIN;
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;

poll_wait(file, &cinergyt2->poll_wq, wait);
Expand Down Expand Up @@ -625,7 +635,9 @@ static int cinergyt2_ioctl (struct inode *inode, struct file *file,
if (copy_from_user(&p, (void __user*) arg, sizeof(p)))
return -EFAULT;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
if (cinergyt2->disconnect_pending)
return -EAGAIN;
if (mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;

param->cmd = CINERGYT2_EP1_SET_TUNER_PARAMETERS;
Expand Down Expand Up @@ -996,7 +1008,9 @@ static int cinergyt2_suspend (struct usb_interface *intf, pm_message_t state)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
if (cinergyt2->disconnect_pending)
return -EAGAIN;
if (mutex_lock_interruptible(&cinergyt2->wq_sem))
return -ERESTARTSYS;

cinergyt2_suspend_rc(cinergyt2);
Expand All @@ -1017,16 +1031,18 @@ static int cinergyt2_resume (struct usb_interface *intf)
{
struct cinergyt2 *cinergyt2 = usb_get_intfdata (intf);
struct dvbt_set_parameters_msg *param = &cinergyt2->param;
int err = -ERESTARTSYS;
int err = -EAGAIN;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->wq_sem))
if (cinergyt2->disconnect_pending)
goto out;
err = mutex_lock_interruptible(&cinergyt2->wq_sem);
if (err)
goto out;

if (mutex_lock_interruptible(&cinergyt2->sem))
err = mutex_lock_interruptible(&cinergyt2->sem);
if (err)
goto out_unlock1;

err = 0;

if (!cinergyt2->sleeping) {
cinergyt2_sleep(cinergyt2, 0);
cinergyt2_command(cinergyt2, (char *) param, sizeof(*param), NULL, 0);
Expand Down

0 comments on commit 018453a

Please sign in to comment.