diff options
author | Anatolij Gustschin <agust@denx.de> | 2011-02-19 15:33:18 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:29:44 -0400 |
commit | 2f9700062cf67b14729b2916ba662e7884d3e0c5 (patch) | |
tree | 7407b17ee71528860491782ae17337fcbc959d87 /drivers/media/video/fsl-viu.c | |
parent | 8d115931622eb19a15f2633cb35dd2c4a66db255 (diff) |
[media] fsl-viu: replace .ioctl by .unlocked_ioctl
Use the core-assisted locking in fsl-viu driver and switch
to .unlocked_ioctl.
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/fsl-viu.c')
-rw-r--r-- | drivers/media/video/fsl-viu.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index 031af1610154..575f39b3c677 100644 --- a/drivers/media/video/fsl-viu.c +++ b/drivers/media/video/fsl-viu.c | |||
@@ -825,13 +825,11 @@ static int vidioc_s_fmt_overlay(struct file *file, void *priv, | |||
825 | if (err) | 825 | if (err) |
826 | return err; | 826 | return err; |
827 | 827 | ||
828 | mutex_lock(&dev->lock); | ||
829 | fh->win = f->fmt.win; | 828 | fh->win = f->fmt.win; |
830 | 829 | ||
831 | spin_lock_irqsave(&dev->slock, flags); | 830 | spin_lock_irqsave(&dev->slock, flags); |
832 | viu_start_preview(dev, fh); | 831 | viu_start_preview(dev, fh); |
833 | spin_unlock_irqrestore(&dev->slock, flags); | 832 | spin_unlock_irqrestore(&dev->slock, flags); |
834 | mutex_unlock(&dev->lock); | ||
835 | return 0; | 833 | return 0; |
836 | } | 834 | } |
837 | 835 | ||
@@ -1311,7 +1309,8 @@ static int viu_open(struct file *file) | |||
1311 | videobuf_queue_dma_contig_init(&fh->vb_vidq, &viu_video_qops, | 1309 | videobuf_queue_dma_contig_init(&fh->vb_vidq, &viu_video_qops, |
1312 | dev->dev, &fh->vbq_lock, | 1310 | dev->dev, &fh->vbq_lock, |
1313 | fh->type, V4L2_FIELD_INTERLACED, | 1311 | fh->type, V4L2_FIELD_INTERLACED, |
1314 | sizeof(struct viu_buf), fh, NULL); | 1312 | sizeof(struct viu_buf), fh, |
1313 | &fh->dev->lock); | ||
1315 | return 0; | 1314 | return 0; |
1316 | } | 1315 | } |
1317 | 1316 | ||
@@ -1401,7 +1400,7 @@ static struct v4l2_file_operations viu_fops = { | |||
1401 | .release = viu_release, | 1400 | .release = viu_release, |
1402 | .read = viu_read, | 1401 | .read = viu_read, |
1403 | .poll = viu_poll, | 1402 | .poll = viu_poll, |
1404 | .ioctl = video_ioctl2, /* V4L2 ioctl handler */ | 1403 | .unlocked_ioctl = video_ioctl2, /* V4L2 ioctl handler */ |
1405 | .mmap = viu_mmap, | 1404 | .mmap = viu_mmap, |
1406 | }; | 1405 | }; |
1407 | 1406 | ||
@@ -1498,9 +1497,6 @@ static int __devinit viu_of_probe(struct platform_device *op) | |||
1498 | INIT_LIST_HEAD(&viu_dev->vidq.active); | 1497 | INIT_LIST_HEAD(&viu_dev->vidq.active); |
1499 | INIT_LIST_HEAD(&viu_dev->vidq.queued); | 1498 | INIT_LIST_HEAD(&viu_dev->vidq.queued); |
1500 | 1499 | ||
1501 | /* initialize locks */ | ||
1502 | mutex_init(&viu_dev->lock); | ||
1503 | |||
1504 | snprintf(viu_dev->v4l2_dev.name, | 1500 | snprintf(viu_dev->v4l2_dev.name, |
1505 | sizeof(viu_dev->v4l2_dev.name), "%s", "VIU"); | 1501 | sizeof(viu_dev->v4l2_dev.name), "%s", "VIU"); |
1506 | ret = v4l2_device_register(viu_dev->dev, &viu_dev->v4l2_dev); | 1502 | ret = v4l2_device_register(viu_dev->dev, &viu_dev->v4l2_dev); |
@@ -1531,8 +1527,15 @@ static int __devinit viu_of_probe(struct platform_device *op) | |||
1531 | 1527 | ||
1532 | viu_dev->vdev = vdev; | 1528 | viu_dev->vdev = vdev; |
1533 | 1529 | ||
1530 | /* initialize locks */ | ||
1531 | mutex_init(&viu_dev->lock); | ||
1532 | viu_dev->vdev->lock = &viu_dev->lock; | ||
1533 | spin_lock_init(&viu_dev->slock); | ||
1534 | |||
1534 | video_set_drvdata(viu_dev->vdev, viu_dev); | 1535 | video_set_drvdata(viu_dev->vdev, viu_dev); |
1535 | 1536 | ||
1537 | mutex_lock(&viu_dev->lock); | ||
1538 | |||
1536 | ret = video_register_device(viu_dev->vdev, VFL_TYPE_GRABBER, -1); | 1539 | ret = video_register_device(viu_dev->vdev, VFL_TYPE_GRABBER, -1); |
1537 | if (ret < 0) { | 1540 | if (ret < 0) { |
1538 | video_device_release(viu_dev->vdev); | 1541 | video_device_release(viu_dev->vdev); |
@@ -1559,6 +1562,8 @@ static int __devinit viu_of_probe(struct platform_device *op) | |||
1559 | goto err_irq; | 1562 | goto err_irq; |
1560 | } | 1563 | } |
1561 | 1564 | ||
1565 | mutex_unlock(&viu_dev->lock); | ||
1566 | |||
1562 | dev_info(&op->dev, "Freescale VIU Video Capture Board\n"); | 1567 | dev_info(&op->dev, "Freescale VIU Video Capture Board\n"); |
1563 | return ret; | 1568 | return ret; |
1564 | 1569 | ||
@@ -1568,6 +1573,7 @@ err_irq: | |||
1568 | err_clk: | 1573 | err_clk: |
1569 | video_unregister_device(viu_dev->vdev); | 1574 | video_unregister_device(viu_dev->vdev); |
1570 | err_vdev: | 1575 | err_vdev: |
1576 | mutex_unlock(&viu_dev->lock); | ||
1571 | i2c_put_adapter(ad); | 1577 | i2c_put_adapter(ad); |
1572 | v4l2_device_unregister(&viu_dev->v4l2_dev); | 1578 | v4l2_device_unregister(&viu_dev->v4l2_dev); |
1573 | err: | 1579 | err: |