summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/saa7134/saa7134-empress.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-empress.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/linux/drivers/media/video/saa7134/saa7134-empress.c b/linux/drivers/media/video/saa7134/saa7134-empress.c
index a7c38745b..4bce95289 100644
--- a/linux/drivers/media/video/saa7134/saa7134-empress.c
+++ b/linux/drivers/media/video/saa7134/saa7134-empress.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-empress.c,v 1.9 2004/12/10 12:33:39 kraxel Exp $
+ * $Id: saa7134-empress.c,v 1.10 2005/02/03 10:24:33 kraxel Exp $
*
* (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
*
@@ -96,17 +96,19 @@ static int ts_open(struct inode *inode, struct file *file)
return -ENODEV;
dprintk("open minor=%d\n",minor);
- down(&dev->empress_tsq.lock);
err = -EBUSY;
- if (dev->empress_users)
+ if (down_trylock(&dev->empress_tsq.lock))
goto done;
+ if (dev->empress_users)
+ goto done_up;
dev->empress_users++;
file->private_data = dev;
err = 0;
- done:
+done_up:
up(&dev->empress_tsq.lock);
+done:
return err;
}