From b48bcfd2d8bf53f6f1805ecbc3a0187a25cc82a1 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Thu, 21 Aug 2003 09:52:45 +0000 Subject: Port the latest video device changes (multiple read device opens) to "dvb-kernel", change the av7110 driver accordingly. --- linux/drivers/media/dvb/dvb-core/dvbdev.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'linux/drivers/media/dvb/dvb-core/dvbdev.c') 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; } -- cgit v1.2.3