diff options
author | Michael Hunold <devnull@localhost> | 2003-08-21 09:52:45 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-08-21 09:52:45 +0000 |
commit | b48bcfd2d8bf53f6f1805ecbc3a0187a25cc82a1 (patch) | |
tree | 9d0cd0f905cd6f814d119cbd06aefcccbc1e0985 /linux/drivers/media/dvb/dvb-core/dvbdev.c | |
parent | c25c5c1d21edff235ed92175a0a7085ff1b6b835 (diff) | |
download | mediapointer-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.c | 13 |
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; } |