summaryrefslogtreecommitdiff
path: root/drivers/media/platform/omap24xxcam.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-06-12 06:03:27 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-06-21 11:05:16 -0300
commit7a86969bd65eb7f19ea1c281c686a75429be950a (patch)
tree052e0c6cf096a2633d9f39934f1ad7c2bccf112f /drivers/media/platform/omap24xxcam.c
parentb60f9aa1a9fcf69df963c1f06ee0594d836f6760 (diff)
[media] omap24xxcam: add v4l2_device and replace parent with v4l2_dev
This driver did not yet support struct v4l2_device, so add it. This make it possible to replace the deprecated parent field with the v4l2_dev field, allowing the eventual removal of the parent field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/omap24xxcam.c')
-rw-r--r--drivers/media/platform/omap24xxcam.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/media/platform/omap24xxcam.c b/drivers/media/platform/omap24xxcam.c
index debb44ceb185..d2b440c842b3 100644
--- a/drivers/media/platform/omap24xxcam.c
+++ b/drivers/media/platform/omap24xxcam.c
@@ -1656,7 +1656,7 @@ static int omap24xxcam_device_register(struct v4l2_int_device *s)
}
vfd->release = video_device_release;
- vfd->parent = cam->dev;
+ vfd->v4l2_dev = &cam->v4l2_dev;
strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name));
vfd->fops = &omap24xxcam_fops;
@@ -1752,6 +1752,11 @@ static int omap24xxcam_probe(struct platform_device *pdev)
cam->dev = &pdev->dev;
+ if (v4l2_device_register(&pdev->dev, &cam->v4l2_dev)) {
+ dev_err(&pdev->dev, "v4l2_device_register failed\n");
+ goto err;
+ }
+
/*
* Impose a lower limit on the amount of memory allocated for
* capture. We require at least enough memory to double-buffer
@@ -1849,6 +1854,8 @@ static int omap24xxcam_remove(struct platform_device *pdev)
cam->mmio_base_phys = 0;
}
+ v4l2_device_unregister(&cam->v4l2_dev);
+
kfree(cam);
return 0;