Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61359
b: refs/heads/master
c: 51b5402
h: refs/heads/master
i:
  61357: 935ea5d
  61355: c5e8747
  61351: 944fb27
  61343: c6e2370
v: v3
  • Loading branch information
Matthias Kaehlcke authored and Mauro Carvalho Chehab committed Jul 18, 2007
1 parent bfe1344 commit 4e935d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9378fdbc334d1575b492108eac822a78c0c46d9
refs/heads/master: 51b540292a349b380ccc0572401c6ac343acdf4a
15 changes: 8 additions & 7 deletions trunk/drivers/media/video/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <linux/pci.h>
#include <linux/random.h>
#include <linux/version.h>
#include <linux/mutex.h>
#include <linux/videodev2.h>
#include <linux/dma-mapping.h>
#ifdef CONFIG_VIDEO_V4L1_COMPAT
Expand Down Expand Up @@ -165,7 +166,7 @@ static LIST_HEAD(vivi_devlist);
struct vivi_dev {
struct list_head vivi_devlist;

struct semaphore lock;
struct mutex lock;

int users;

Expand Down Expand Up @@ -738,16 +739,16 @@ static struct videobuf_queue_ops vivi_video_qops = {
static int res_get(struct vivi_dev *dev, struct vivi_fh *fh)
{
/* is it free? */
down(&dev->lock);
mutex_lock(&dev->lock);
if (dev->resources) {
/* no, someone else uses it */
up(&dev->lock);
mutex_unlock(&dev->lock);
return 0;
}
/* it's free, grab it */
dev->resources =1;
dprintk(1,"res: get\n");
up(&dev->lock);
mutex_unlock(&dev->lock);
return 1;
}

Expand All @@ -758,10 +759,10 @@ static int res_locked(struct vivi_dev *dev)

static void res_free(struct vivi_dev *dev, struct vivi_fh *fh)
{
down(&dev->lock);
mutex_lock(&dev->lock);
dev->resources = 0;
dprintk(1,"res: put\n");
up(&dev->lock);
mutex_lock(&dev->lock);
}

/* ------------------------------------------------------------------
Expand Down Expand Up @@ -1260,7 +1261,7 @@ static int __init vivi_init(void)
init_waitqueue_head(&dev->vidq.wq);

/* initialize locks */
init_MUTEX(&dev->lock);
mutex_init(&dev->lock);

dev->vidq.timeout.function = vivi_vid_timeout;
dev->vidq.timeout.data = (unsigned long)dev;
Expand Down

0 comments on commit 4e935d2

Please sign in to comment.