V4L/DVB (3318b): sem2mutex: drivers/media/, #2
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
538f9630af
commit
3593cab5d6
@@ -17,18 +17,18 @@ int saa7146_res_get(struct saa7146_fh *fh, unsigned int bit)
|
||||
}
|
||||
|
||||
/* is it free? */
|
||||
down(&dev->lock);
|
||||
mutex_lock(&dev->lock);
|
||||
if (vv->resources & bit) {
|
||||
DEB_D(("locked! vv->resources:0x%02x, we want:0x%02x\n",vv->resources,bit));
|
||||
/* no, someone else uses it */
|
||||
up(&dev->lock);
|
||||
mutex_unlock(&dev->lock);
|
||||
return 0;
|
||||
}
|
||||
/* it's free, grab it */
|
||||
fh->resources |= bit;
|
||||
vv->resources |= bit;
|
||||
DEB_D(("res: get 0x%02x, cur:0x%02x\n",bit,vv->resources));
|
||||
up(&dev->lock);
|
||||
mutex_unlock(&dev->lock);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -40,11 +40,11 @@ void saa7146_res_free(struct saa7146_fh *fh, unsigned int bits)
|
||||
if ((fh->resources & bits) != bits)
|
||||
BUG();
|
||||
|
||||
down(&dev->lock);
|
||||
mutex_lock(&dev->lock);
|
||||
fh->resources &= ~bits;
|
||||
vv->resources &= ~bits;
|
||||
DEB_D(("res: put 0x%02x, cur:0x%02x\n",bits,vv->resources));
|
||||
up(&dev->lock);
|
||||
mutex_unlock(&dev->lock);
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ static int fops_open(struct inode *inode, struct file *file)
|
||||
|
||||
DEB_EE(("inode:%p, file:%p, minor:%d\n",inode,file,minor));
|
||||
|
||||
if (down_interruptible(&saa7146_devices_lock))
|
||||
if (mutex_lock_interruptible(&saa7146_devices_lock))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
list_for_each(list,&saa7146_devices) {
|
||||
@@ -276,7 +276,7 @@ out:
|
||||
kfree(fh);
|
||||
file->private_data = NULL;
|
||||
}
|
||||
up(&saa7146_devices_lock);
|
||||
mutex_unlock(&saa7146_devices_lock);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ static int fops_release(struct inode *inode, struct file *file)
|
||||
|
||||
DEB_EE(("inode:%p, file:%p\n",inode,file));
|
||||
|
||||
if (down_interruptible(&saa7146_devices_lock))
|
||||
if (mutex_lock_interruptible(&saa7146_devices_lock))
|
||||
return -ERESTARTSYS;
|
||||
|
||||
if( fh->type == V4L2_BUF_TYPE_VBI_CAPTURE) {
|
||||
@@ -303,7 +303,7 @@ static int fops_release(struct inode *inode, struct file *file)
|
||||
file->private_data = NULL;
|
||||
kfree(fh);
|
||||
|
||||
up(&saa7146_devices_lock);
|
||||
mutex_unlock(&saa7146_devices_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user