summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core/dvbdev.c
diff options
context:
space:
mode:
authorMichael Hunold <devnull@localhost>2003-08-21 09:52:45 +0000
committerMichael Hunold <devnull@localhost>2003-08-21 09:52:45 +0000
commitb48bcfd2d8bf53f6f1805ecbc3a0187a25cc82a1 (patch)
tree9d0cd0f905cd6f814d119cbd06aefcccbc1e0985 /linux/drivers/media/dvb/dvb-core/dvbdev.c
parentc25c5c1d21edff235ed92175a0a7085ff1b6b835 (diff)
downloadmediapointer-dvb-s2-b48bcfd2d8bf53f6f1805ecbc3a0187a25cc82a1.tar.gz
mediapointer-dvb-s2-b48bcfd2d8bf53f6f1805ecbc3a0187a25cc82a1.tar.bz2
Port the latest video device changes (multiple read device opens)
to "dvb-kernel", change the av7110 driver accordingly.
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvbdev.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c
index 1e9d07b8f..7f3421778 100644
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c
@@ -121,7 +121,11 @@ int dvb_generic_open(struct inode *inode, struct file *file)
if (!dvbdev->users)
return -EBUSY;
- if ((file->f_flags & O_ACCMODE) != O_RDONLY) {
+ if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
+ if (!dvbdev->readers)
+ return -EBUSY;
+ dvbdev->readers--;
+ } else {
if (!dvbdev->writers)
return -EBUSY;
dvbdev->writers--;
@@ -139,9 +143,12 @@ int dvb_generic_release(struct inode *inode, struct file *file)
if (!dvbdev)
return -ENODEV;
- if ((file->f_flags & O_ACCMODE) != O_RDONLY)
+ if ((file->f_flags & O_ACCMODE) == O_RDONLY) {
+ dvbdev->readers++;
+ } else {
dvbdev->writers++;
-
+ }
+
dvbdev->users++;
return 0;
}