This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:

Subject: [media] m2m-deinterlace: embed video_device
Author:  Hans Verkuil <[email protected]>
Date:    Mon Mar 9 13:34:05 2015 -0300

Embed the video_device struct to simplify the error handling and in
order to (eventually) get rid of video_device_alloc/release.

Signed-off-by: Hans Verkuil <[email protected]>
Cc: Javier Martin <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/m2m-deinterlace.c |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=650e629bf7a782ce3c646f12a0ec381147b2c9b9

diff --git a/drivers/media/platform/m2m-deinterlace.c 
b/drivers/media/platform/m2m-deinterlace.c
index b70c1ae..92d9549 100644
--- a/drivers/media/platform/m2m-deinterlace.c
+++ b/drivers/media/platform/m2m-deinterlace.c
@@ -127,7 +127,7 @@ static struct deinterlace_fmt *find_format(struct 
v4l2_format *f)
 
 struct deinterlace_dev {
        struct v4l2_device      v4l2_dev;
-       struct video_device     *vfd;
+       struct video_device     vfd;
 
        atomic_t                busy;
        struct mutex            dev_mutex;
@@ -983,7 +983,7 @@ static struct video_device deinterlace_videodev = {
        .fops           = &deinterlace_fops,
        .ioctl_ops      = &deinterlace_ioctl_ops,
        .minor          = -1,
-       .release        = video_device_release,
+       .release        = video_device_release_empty,
        .vfl_dir        = VFL_DIR_M2M,
 };
 
@@ -1026,13 +1026,7 @@ static int deinterlace_probe(struct platform_device 
*pdev)
        atomic_set(&pcdev->busy, 0);
        mutex_init(&pcdev->dev_mutex);
 
-       vfd = video_device_alloc();
-       if (!vfd) {
-               v4l2_err(&pcdev->v4l2_dev, "Failed to allocate video device\n");
-               ret = -ENOMEM;
-               goto unreg_dev;
-       }
-
+       vfd = &pcdev->vfd;
        *vfd = deinterlace_videodev;
        vfd->lock = &pcdev->dev_mutex;
        vfd->v4l2_dev = &pcdev->v4l2_dev;
@@ -1040,12 +1034,11 @@ static int deinterlace_probe(struct platform_device 
*pdev)
        ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
        if (ret) {
                v4l2_err(&pcdev->v4l2_dev, "Failed to register video device\n");
-               goto rel_vdev;
+               goto unreg_dev;
        }
 
        video_set_drvdata(vfd, pcdev);
        snprintf(vfd->name, sizeof(vfd->name), "%s", deinterlace_videodev.name);
-       pcdev->vfd = vfd;
        v4l2_info(&pcdev->v4l2_dev, MEM2MEM_TEST_MODULE_NAME
                        " Device registered as /dev/video%d\n", vfd->num);
 
@@ -1069,11 +1062,9 @@ static int deinterlace_probe(struct platform_device 
*pdev)
 
        v4l2_m2m_release(pcdev->m2m_dev);
 err_m2m:
-       video_unregister_device(pcdev->vfd);
+       video_unregister_device(&pcdev->vfd);
 err_ctx:
        vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
-rel_vdev:
-       video_device_release(vfd);
 unreg_dev:
        v4l2_device_unregister(&pcdev->v4l2_dev);
 rel_dma:
@@ -1088,7 +1079,7 @@ static int deinterlace_remove(struct platform_device 
*pdev)
 
        v4l2_info(&pcdev->v4l2_dev, "Removing " MEM2MEM_TEST_MODULE_NAME);
        v4l2_m2m_release(pcdev->m2m_dev);
-       video_unregister_device(pcdev->vfd);
+       video_unregister_device(&pcdev->vfd);
        v4l2_device_unregister(&pcdev->v4l2_dev);
        vb2_dma_contig_cleanup_ctx(pcdev->alloc_ctx);
        dma_release_channel(pcdev->dma_chan);

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to