Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65804
b: refs/heads/master
c: 48136e1
h: refs/heads/master
v: v3
  • Loading branch information
Oliver Endriss authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent 389a53c commit ece42ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 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: 226835d7e0a1136bce2a0b923e0832ab47450a30
refs/heads/master: 48136e1e93195b56dc3d9b0730917241b3365633
38 changes: 22 additions & 16 deletions trunk/drivers/media/dvb/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1056,32 +1056,36 @@ static int dvb_frontend_open(struct inode *inode, struct file *file)

dprintk ("%s\n", __FUNCTION__);

if ((ret = dvb_generic_open (inode, file)) < 0)
return ret;

if (fe->ops.ts_bus_ctrl) {
if ((ret = fe->ops.ts_bus_ctrl (fe, 1)) < 0) {
dvb_generic_release (inode, file);
if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl) {
if ((ret = fe->ops.ts_bus_ctrl(fe, 1)) < 0)
return ret;
}
}

if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
if ((ret = dvb_generic_open (inode, file)) < 0)
goto err1;

if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
/* normal tune mode when opened R/W */
fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT;
fepriv->tone = -1;
fepriv->voltage = -1;

ret = dvb_frontend_start (fe);
if (ret)
dvb_generic_release (inode, file);
goto err2;

/* empty event queue */
fepriv->events.eventr = fepriv->events.eventw = 0;
}

return ret;

err2:
dvb_generic_release(inode, file);
err1:
if (dvbdev->users == -1 && fe->ops.ts_bus_ctrl)
fe->ops.ts_bus_ctrl(fe, 0);
return ret;
}

static int dvb_frontend_release(struct inode *inode, struct file *file)
Expand All @@ -1096,16 +1100,18 @@ static int dvb_frontend_release(struct inode *inode, struct file *file)
if ((file->f_flags & O_ACCMODE) != O_RDONLY)
fepriv->release_jiffies = jiffies;

if (fe->ops.ts_bus_ctrl)
fe->ops.ts_bus_ctrl (fe, 0);

ret = dvb_generic_release (inode, file);

if (dvbdev->users==-1 && fepriv->exit==1) {
fops_put(file->f_op);
file->f_op = NULL;
wake_up(&dvbdev->wait_queue);
if (dvbdev->users == -1) {
if (fepriv->exit == 1) {
fops_put(file->f_op);
file->f_op = NULL;
wake_up(&dvbdev->wait_queue);
}
if (fe->ops.ts_bus_ctrl)
fe->ops.ts_bus_ctrl(fe, 0);
}

return ret;
}

Expand Down

0 comments on commit ece42ac

Please sign in to comment.