diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-06-12 05:03:27 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-06-21 10:05:16 -0400 |
commit | 7a86969bd65eb7f19ea1c281c686a75429be950a (patch) | |
tree | 052e0c6cf096a2633d9f39934f1ad7c2bccf112f | |
parent | b60f9aa1a9fcf69df963c1f06ee0594d836f6760 (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>
-rw-r--r-- | drivers/media/platform/omap24xxcam.c | 9 | ||||
-rw-r--r-- | drivers/media/platform/omap24xxcam.h | 3 |
2 files changed, 11 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) | |||
1656 | } | 1656 | } |
1657 | vfd->release = video_device_release; | 1657 | vfd->release = video_device_release; |
1658 | 1658 | ||
1659 | vfd->parent = cam->dev; | 1659 | vfd->v4l2_dev = &cam->v4l2_dev; |
1660 | 1660 | ||
1661 | strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name)); | 1661 | strlcpy(vfd->name, CAM_NAME, sizeof(vfd->name)); |
1662 | vfd->fops = &omap24xxcam_fops; | 1662 | vfd->fops = &omap24xxcam_fops; |
@@ -1752,6 +1752,11 @@ static int omap24xxcam_probe(struct platform_device *pdev) | |||
1752 | 1752 | ||
1753 | cam->dev = &pdev->dev; | 1753 | cam->dev = &pdev->dev; |
1754 | 1754 | ||
1755 | if (v4l2_device_register(&pdev->dev, &cam->v4l2_dev)) { | ||
1756 | dev_err(&pdev->dev, "v4l2_device_register failed\n"); | ||
1757 | goto err; | ||
1758 | } | ||
1759 | |||
1755 | /* | 1760 | /* |
1756 | * Impose a lower limit on the amount of memory allocated for | 1761 | * Impose a lower limit on the amount of memory allocated for |
1757 | * capture. We require at least enough memory to double-buffer | 1762 | * capture. We require at least enough memory to double-buffer |
@@ -1849,6 +1854,8 @@ static int omap24xxcam_remove(struct platform_device *pdev) | |||
1849 | cam->mmio_base_phys = 0; | 1854 | cam->mmio_base_phys = 0; |
1850 | } | 1855 | } |
1851 | 1856 | ||
1857 | v4l2_device_unregister(&cam->v4l2_dev); | ||
1858 | |||
1852 | kfree(cam); | 1859 | kfree(cam); |
1853 | 1860 | ||
1854 | return 0; | 1861 | return 0; |
diff --git a/drivers/media/platform/omap24xxcam.h b/drivers/media/platform/omap24xxcam.h index c4395956a493..7f6f79155537 100644 --- a/drivers/media/platform/omap24xxcam.h +++ b/drivers/media/platform/omap24xxcam.h | |||
@@ -29,6 +29,7 @@ | |||
29 | 29 | ||
30 | #include <media/videobuf-dma-sg.h> | 30 | #include <media/videobuf-dma-sg.h> |
31 | #include <media/v4l2-int-device.h> | 31 | #include <media/v4l2-int-device.h> |
32 | #include <media/v4l2-device.h> | ||
32 | 33 | ||
33 | /* | 34 | /* |
34 | * | 35 | * |
@@ -462,6 +463,8 @@ struct omap24xxcam_device { | |||
462 | */ | 463 | */ |
463 | struct mutex mutex; | 464 | struct mutex mutex; |
464 | 465 | ||
466 | struct v4l2_device v4l2_dev; | ||
467 | |||
465 | /*** general driver state information ***/ | 468 | /*** general driver state information ***/ |
466 | atomic_t users; | 469 | atomic_t users; |
467 | /* | 470 | /* |