|
@@ -62,7 +62,7 @@ enum sh_vou_status {
|
|
|
|
|
|
struct sh_vou_device {
|
|
struct sh_vou_device {
|
|
struct v4l2_device v4l2_dev;
|
|
struct v4l2_device v4l2_dev;
|
|
- struct video_device *vdev;
|
|
|
|
|
|
+ struct video_device vdev;
|
|
atomic_t use_count;
|
|
atomic_t use_count;
|
|
struct sh_vou_pdata *pdata;
|
|
struct sh_vou_pdata *pdata;
|
|
spinlock_t lock;
|
|
spinlock_t lock;
|
|
@@ -890,7 +890,7 @@ static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id)
|
|
|
|
|
|
dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id);
|
|
dev_dbg(vou_dev->v4l2_dev.dev, "%s(): 0x%llx\n", __func__, std_id);
|
|
|
|
|
|
- if (std_id & ~vou_dev->vdev->tvnorms)
|
|
|
|
|
|
+ if (std_id & ~vou_dev->vdev.tvnorms)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video,
|
|
ret = v4l2_device_call_until_err(&vou_dev->v4l2_dev, 0, video,
|
|
@@ -1193,7 +1193,7 @@ static int sh_vou_open(struct file *file)
|
|
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
|
V4L2_BUF_TYPE_VIDEO_OUTPUT,
|
|
V4L2_FIELD_NONE,
|
|
V4L2_FIELD_NONE,
|
|
sizeof(struct videobuf_buffer),
|
|
sizeof(struct videobuf_buffer),
|
|
- vou_dev->vdev, &vou_dev->fop_lock);
|
|
|
|
|
|
+ &vou_dev->vdev, &vou_dev->fop_lock);
|
|
mutex_unlock(&vou_dev->fop_lock);
|
|
mutex_unlock(&vou_dev->fop_lock);
|
|
|
|
|
|
file->private_data = vou_file;
|
|
file->private_data = vou_file;
|
|
@@ -1361,21 +1361,14 @@ static int sh_vou_probe(struct platform_device *pdev)
|
|
goto ev4l2devreg;
|
|
goto ev4l2devreg;
|
|
}
|
|
}
|
|
|
|
|
|
- /* Allocate memory for video device */
|
|
|
|
- vdev = video_device_alloc();
|
|
|
|
- if (vdev == NULL) {
|
|
|
|
- ret = -ENOMEM;
|
|
|
|
- goto evdevalloc;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ vdev = &vou_dev->vdev;
|
|
*vdev = sh_vou_video_template;
|
|
*vdev = sh_vou_video_template;
|
|
if (vou_pdata->bus_fmt == SH_VOU_BUS_8BIT)
|
|
if (vou_pdata->bus_fmt == SH_VOU_BUS_8BIT)
|
|
vdev->tvnorms |= V4L2_STD_PAL;
|
|
vdev->tvnorms |= V4L2_STD_PAL;
|
|
vdev->v4l2_dev = &vou_dev->v4l2_dev;
|
|
vdev->v4l2_dev = &vou_dev->v4l2_dev;
|
|
- vdev->release = video_device_release;
|
|
|
|
|
|
+ vdev->release = video_device_release_empty;
|
|
vdev->lock = &vou_dev->fop_lock;
|
|
vdev->lock = &vou_dev->fop_lock;
|
|
|
|
|
|
- vou_dev->vdev = vdev;
|
|
|
|
video_set_drvdata(vdev, vou_dev);
|
|
video_set_drvdata(vdev, vou_dev);
|
|
|
|
|
|
pm_runtime_enable(&pdev->dev);
|
|
pm_runtime_enable(&pdev->dev);
|
|
@@ -1409,9 +1402,7 @@ ei2cnd:
|
|
ereset:
|
|
ereset:
|
|
i2c_put_adapter(i2c_adap);
|
|
i2c_put_adapter(i2c_adap);
|
|
ei2cgadap:
|
|
ei2cgadap:
|
|
- video_device_release(vdev);
|
|
|
|
pm_runtime_disable(&pdev->dev);
|
|
pm_runtime_disable(&pdev->dev);
|
|
-evdevalloc:
|
|
|
|
v4l2_device_unregister(&vou_dev->v4l2_dev);
|
|
v4l2_device_unregister(&vou_dev->v4l2_dev);
|
|
ev4l2devreg:
|
|
ev4l2devreg:
|
|
free_irq(irq, vou_dev);
|
|
free_irq(irq, vou_dev);
|
|
@@ -1438,7 +1429,7 @@ static int sh_vou_remove(struct platform_device *pdev)
|
|
if (irq > 0)
|
|
if (irq > 0)
|
|
free_irq(irq, vou_dev);
|
|
free_irq(irq, vou_dev);
|
|
pm_runtime_disable(&pdev->dev);
|
|
pm_runtime_disable(&pdev->dev);
|
|
- video_unregister_device(vou_dev->vdev);
|
|
|
|
|
|
+ video_unregister_device(&vou_dev->vdev);
|
|
i2c_put_adapter(client->adapter);
|
|
i2c_put_adapter(client->adapter);
|
|
v4l2_device_unregister(&vou_dev->v4l2_dev);
|
|
v4l2_device_unregister(&vou_dev->v4l2_dev);
|
|
iounmap(vou_dev->base);
|
|
iounmap(vou_dev->base);
|