Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330715
b: refs/heads/master
c: 549ee4d
h: refs/heads/master
i:
  330713: 8d57a60
  330711: a21956b
v: v3
  • Loading branch information
Devin Heitmueller authored and Mauro Carvalho Chehab committed Aug 9, 2012
1 parent 85a03c7 commit 47644f1
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 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: 0a3dabb15ef9039188464647113398ed95400318
refs/heads/master: 549ee4df1951c8a1a123e81a073d73c2e1c26588
5 changes: 5 additions & 0 deletions trunk/drivers/media/video/au0828/au0828-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,8 @@ static int au0828_usb_probe(struct usb_interface *interface,
return -ENOMEM;
}

mutex_init(&dev->lock);
mutex_lock(&dev->lock);
mutex_init(&dev->mutex);
mutex_init(&dev->dvb.lock);
dev->usbdev = usbdev;
Expand All @@ -215,6 +217,7 @@ static int au0828_usb_probe(struct usb_interface *interface,
if (retval) {
printk(KERN_ERR "%s() v4l2_device_register failed\n",
__func__);
mutex_unlock(&dev->lock);
kfree(dev);
return -EIO;
}
Expand Down Expand Up @@ -245,6 +248,8 @@ static int au0828_usb_probe(struct usb_interface *interface,
printk(KERN_INFO "Registered device AU0828 [%s]\n",
dev->board.name == NULL ? "Unset" : dev->board.name);

mutex_unlock(&dev->lock);

return 0;
}

Expand Down
21 changes: 8 additions & 13 deletions trunk/drivers/media/video/au0828/au0828-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -864,17 +864,15 @@ static int res_get(struct au0828_fh *fh, unsigned int bit)
return 1;

/* is it free? */
mutex_lock(&dev->lock);
if (dev->resources & bit) {
/* no, someone else uses it */
mutex_unlock(&dev->lock);
return 0;
}
/* it's free, grab it */
fh->resources |= bit;
dev->resources |= bit;
dprintk(1, "res: get %d\n", bit);
mutex_unlock(&dev->lock);

return 1;
}

Expand All @@ -894,11 +892,9 @@ static void res_free(struct au0828_fh *fh, unsigned int bits)

BUG_ON((fh->resources & bits) != bits);

mutex_lock(&dev->lock);
fh->resources &= ~bits;
dev->resources &= ~bits;
dprintk(1, "res: put %d\n", bits);
mutex_unlock(&dev->lock);
}

static int get_ressource(struct au0828_fh *fh)
Expand Down Expand Up @@ -1023,7 +1019,8 @@ static int au0828_v4l2_open(struct file *filp)
NULL, &dev->slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED,
sizeof(struct au0828_buffer), fh, NULL);
sizeof(struct au0828_buffer), fh,
&dev->lock);

/* VBI Setup */
dev->vbi_width = 720;
Expand All @@ -1032,8 +1029,8 @@ static int au0828_v4l2_open(struct file *filp)
NULL, &dev->slock,
V4L2_BUF_TYPE_VBI_CAPTURE,
V4L2_FIELD_SEQ_TB,
sizeof(struct au0828_buffer), fh, NULL);

sizeof(struct au0828_buffer), fh,
&dev->lock);
return ret;
}

Expand Down Expand Up @@ -1312,8 +1309,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
if (rc < 0)
return rc;

mutex_lock(&dev->lock);

if (videobuf_queue_is_busy(&fh->vb_vidq)) {
printk(KERN_INFO "%s queue busy\n", __func__);
rc = -EBUSY;
Expand All @@ -1322,7 +1317,6 @@ static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,

rc = au0828_set_format(dev, VIDIOC_S_FMT, f);
out:
mutex_unlock(&dev->lock);
return rc;
}

Expand Down Expand Up @@ -1832,7 +1826,7 @@ static struct v4l2_file_operations au0828_v4l_fops = {
.read = au0828_v4l2_read,
.poll = au0828_v4l2_poll,
.mmap = au0828_v4l2_mmap,
.ioctl = video_ioctl2,
.unlocked_ioctl = video_ioctl2,
};

static const struct v4l2_ioctl_ops video_ioctl_ops = {
Expand Down Expand Up @@ -1922,7 +1916,6 @@ int au0828_analog_register(struct au0828_dev *dev,

init_waitqueue_head(&dev->open);
spin_lock_init(&dev->slock);
mutex_init(&dev->lock);

/* init video dma queues */
INIT_LIST_HEAD(&dev->vidq.active);
Expand Down Expand Up @@ -1963,11 +1956,13 @@ int au0828_analog_register(struct au0828_dev *dev,
/* Fill the video capture device struct */
*dev->vdev = au0828_video_template;
dev->vdev->parent = &dev->usbdev->dev;
dev->vdev->lock = &dev->lock;
strcpy(dev->vdev->name, "au0828a video");

/* Setup the VBI device */
*dev->vbi_dev = au0828_video_template;
dev->vbi_dev->parent = &dev->usbdev->dev;
dev->vbi_dev->lock = &dev->lock;
strcpy(dev->vbi_dev->name, "au0828a vbi");

/* Register the v4l2 device */
Expand Down

0 comments on commit 47644f1

Please sign in to comment.