summaryrefslogtreecommitdiff
path: root/drivers/media/platform/soc_camera
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-06-10 09:27:41 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 11:02:24 -0300
commit14381c26771f1a7d6acc57e4c944a9813596e6cf (patch)
treeda4ee73a4940a5e35045dccbd65dbb6591f5c8e2 /drivers/media/platform/soc_camera
parent9e882e3bc97c7774b93f3db483d2e75767b5cad1 (diff)
[media] soc_camera: replace vdev->parent by vdev->v4l2_dev
The parent field will eventually disappear to be replaced by v4l2_dev. soc_camera does provide a v4l2_device struct but did not point to it in struct video_device. This is now fixed. Now the video nodes can be found under the correct platform bus, and the advanced debug ioctls work correctly as well (the core implementation of those ioctls requires that v4l2_dev is set correctly). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/soc_camera')
-rw-r--r--drivers/media/platform/soc_camera/soc_camera.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index fcdd8734f3ec..5099eebf994d 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -524,7 +524,7 @@ static int soc_camera_open(struct file *file)
return -ENODEV;
}
- icd = dev_get_drvdata(vdev->parent);
+ icd = video_get_drvdata(vdev);
ici = to_soc_camera_host(icd->parent);
ret = try_module_get(ici->ops->owner) ? 0 : -ENODEV;
@@ -1477,7 +1477,7 @@ static int video_dev_create(struct soc_camera_device *icd)
strlcpy(vdev->name, ici->drv_name, sizeof(vdev->name));
- vdev->parent = icd->pdev;
+ vdev->v4l2_dev = &ici->v4l2_dev;
vdev->fops = &soc_camera_fops;
vdev->ioctl_ops = &soc_camera_ioctl_ops;
vdev->release = video_device_release;
@@ -1500,6 +1500,7 @@ static int soc_camera_video_start(struct soc_camera_device *icd)
if (!icd->parent)
return -ENODEV;
+ video_set_drvdata(icd->vdev, icd);
ret = video_register_device(icd->vdev, VFL_TYPE_GRABBER, -1);
if (ret < 0) {
dev_err(icd->pdev, "video_register_device failed: %d\n", ret);