diff options
Diffstat (limited to 'drivers/media/common/saa7146_fops.c')
-rw-r--r-- | drivers/media/common/saa7146_fops.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index f8cf73ed49ad..dc7fb20f47b5 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c | |||
@@ -17,18 +17,18 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit) | |||
17 | } | 17 | } |
18 | 18 | ||
19 | /* is it free? */ | 19 | /* is it free? */ |
20 | down(&dev->lock); | 20 | mutex_lock(&dev->lock); |
21 | if (vv->resources & bit) { | 21 | if (vv->resources & bit) { |
22 | DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit)); | 22 | DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit)); |
23 | /* no, someone else uses it */ | 23 | /* no, someone else uses it */ |
24 | up(&dev->lock); | 24 | mutex_unlock(&dev->lock); |
25 | return 0; | 25 | return 0; |
26 | } | 26 | } |
27 | /* it's free, grab it */ | 27 | /* it's free, grab it */ |
28 | fh->resources |= bit; | 28 | fh->resources |= bit; |
29 | vv->resources |= bit; | 29 | vv->resources |= bit; |
30 | DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources)); | 30 | DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources)); |
31 | up(&dev->lock); | 31 | mutex_unlock(&dev->lock); |
32 | return 1; | 32 | return 1; |
33 | } | 33 | } |
34 | 34 | ||
@@ -40,11 +40,11 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits) | |||
40 | if ((fh->resources & bits) != bits) | 40 | if ((fh->resources & bits) != bits) |
41 | BUG(); | 41 | BUG(); |
42 | 42 | ||
43 | down(&dev->lock); | 43 | mutex_lock(&dev->lock); |
44 | fh->resources &= ~bits; | 44 | fh->resources &= ~bits; |
45 | vv->resources &= ~bits; | 45 | vv->resources &= ~bits; |
46 | DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources)); | 46 | DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources)); |
47 | up(&dev->lock); | 47 | mutex_unlock(&dev->lock); |
48 | } | 48 | } |
49 | 49 | ||
50 | 50 | ||
@@ -204,7 +204,7 @@ static int fops_open(struct inode *inode, struct file *file) | |||
204 | 204 | ||
205 | DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor)); | 205 | DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor)); |
206 | 206 | ||
207 | if (down_interruptible(&saa7146_devices_lock)) | 207 | if (mutex_lock_interruptible(&saa7146_devices_lock)) |
208 | return -ERESTARTSYS; | 208 | return -ERESTARTSYS; |
209 | 209 | ||
210 | list_for_each(list,&saa7146_devices) { | 210 | list_for_each(list,&saa7146_devices) { |
@@ -276,7 +276,7 @@ out: | |||
276 | kfree(fh); | 276 | kfree(fh); |
277 | file->private_data = NULL; | 277 | file->private_data = NULL; |
278 | } | 278 | } |
279 | up(&saa7146_devices_lock); | 279 | mutex_unlock(&saa7146_devices_lock); |
280 | return result; | 280 | return result; |
281 | } | 281 | } |
282 | 282 | ||
@@ -287,7 +287,7 @@ static int fops_release(struct inode *inode, struct file *file) | |||
287 | 287 | ||
288 | DEB_EE(("inode:%p, file:%p\n",inode,file)); | 288 | DEB_EE(("inode:%p, file:%p\n",inode,file)); |
289 | 289 | ||
290 | if (down_interruptible(&saa7146_devices_lock)) | 290 | if (mutex_lock_interruptible(&saa7146_devices_lock)) |
291 | return -ERESTARTSYS; | 291 | return -ERESTARTSYS; |
292 | 292 | ||
293 | if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { | 293 | if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) { |
@@ -303,7 +303,7 @@ static int fops_release(struct inode *inode, struct file *file) | |||
303 | file->private_data = NULL; | 303 | file->private_data = NULL; |
304 | kfree(fh); | 304 | kfree(fh); |
305 | 305 | ||
306 | up(&saa7146_devices_lock); | 306 | mutex_unlock(&saa7146_devices_lock); |
307 | 307 | ||
308 | return 0; | 308 | return 0; |
309 | } | 309 | } |