summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorHolger Waechtler <devnull@localhost>2002-12-19 15:44:47 +0000
committerHolger Waechtler <devnull@localhost>2002-12-19 15:44:47 +0000
commit1b4d62218495f2d9a58a2635f6456ebd785ff30c (patch)
treef4f77e0946a45a2f05fb4bc53b228114ae10d7ab /linux/drivers
parenta1bf11171b327cf486596cdb68872eea6913ad73 (diff)
downloadmediapointer-dvb-s2-1b4d62218495f2d9a58a2635f6456ebd785ff30c.tar.gz
mediapointer-dvb-s2-1b4d62218495f2d9a58a2635f6456ebd785ff30c.tar.bz2
use down_interruptible()
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/common/saa7146_core.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/linux/drivers/media/common/saa7146_core.c b/linux/drivers/media/common/saa7146_core.c
index 5a3182769..0c721e100 100644
--- a/linux/drivers/media/common/saa7146_core.c
+++ b/linux/drivers/media/common/saa7146_core.c
@@ -130,7 +130,8 @@ void saa7146_pgtable_build_single(struct pci_dev *pci, struct saa7146_pgtable *p
/********************************************************************************/
/* file operations */
-static int video_open(struct inode *inode, struct file *file)
+static
+int video_open(struct inode *inode, struct file *file)
{
unsigned int minor = minor(inode->i_rdev);
struct saa7146_dev *h = NULL, *dev = NULL;
@@ -142,7 +143,9 @@ static int video_open(struct inode *inode, struct file *file)
DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor));
- down(&devices_lock);
+ if (down_interruptible(&devices_lock))
+ return -ERESTARTSYS;
+
list_for_each(list,&devices) {
h = list_entry(list, struct saa7146_dev, item);
DEB_D(("trying: %p @ major %d,%d\n",h,h->video_dev.minor,h->vbi_dev.minor));
@@ -216,7 +219,8 @@ static int video_release(struct inode *inode, struct file *file)
DEB_EE(("inode:%p, file:%p\n",inode,file));
- down(&devices_lock);
+ if (down_interruptible(&devices_lock))
+ return -ERESTARTSYS;
saa7146_video_uops.release(dev,fh,file);
if( 0 != BOARD_CAN_DO_VBI(dev) ) {
@@ -524,7 +528,9 @@ int saa7146_register_extension(struct saa7146_extension* ext)
DEB_EE(("ext:%p\n",ext));
- down(&devices_lock);
+ if (down_interruptible(&devices_lock))
+ return -ERESTARTSYS;
+
list_for_each(list,&devices) {
int i = 0;
int found = 0;
@@ -619,6 +625,7 @@ int saa7146_register_extension(struct saa7146_extension* ext)
INFO(("%s: registered device vbi%d [v4l2]\n", dev->name,dev->vbi_dev.minor & 0x1f));
}
}
+
up(&devices_lock);
return 0;
@@ -632,6 +639,7 @@ int saa7146_unregister_extension(struct saa7146_extension* ext)
DEB_EE(("ext:%p\n",ext));
down(&devices_lock);
+
list_for_each(list,&devices) {
dev = list_entry(list, struct saa7146_dev, item);
@@ -660,6 +668,7 @@ int saa7146_unregister_extension(struct saa7146_extension* ext)
// dump_registers(dev);
}
+
up(&devices_lock);
return 0;