[ 3.8.y.z extended stable ] Patch "[media] exynos-gsc: Register v4l2 device" has been added to staging queue

Kamal Mostafa kamal at canonical.com
Fri Sep 20 00:36:23 UTC 2013

This is a note to let you know that I have just added a patch titled

    [media] exynos-gsc: Register v4l2 device

to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree 
which can be found at:


This patch is scheduled to be released in version

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.8.y.z tree, see



>From e580ebe7d07baf30ba8ee009c4d2f88e3a691971 Mon Sep 17 00:00:00 2001
From: Arun Kumar K <arun.kk at samsung.com>
Date: Fri, 26 Jul 2013 07:28:01 -0300
Subject: [media] exynos-gsc: Register v4l2 device

commit d0b1c31349969973204fad21a076aecf131cc5e4 upstream.

Gscaler video device registration was happening without reference to
a parent v4l2_dev causing probe to fail. The patch creates a parent
v4l2 device and uses it for the gsc m2m video device registration.
This fixes regression introduced with comit commit 1c1d86a1ea07506
[media] v4l2: always require v4l2_dev, rename parent to dev_parent

Signed-off-by: Arun Kumar K <arun.kk at samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki at samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab at samsung.com>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
 drivers/media/platform/exynos-gsc/gsc-core.c | 9 ++++++++-
 drivers/media/platform/exynos-gsc/gsc-core.h | 1 +
 drivers/media/platform/exynos-gsc/gsc-m2m.c  | 1 +
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.c b/drivers/media/platform/exynos-gsc/gsc-core.c
index 2b1b9f3..661c563 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.c
+++ b/drivers/media/platform/exynos-gsc/gsc-core.c
@@ -1121,10 +1121,14 @@ static int gsc_probe(struct platform_device *pdev)
 		goto err_clk;

-	ret = gsc_register_m2m_device(gsc);
+	ret = v4l2_device_register(dev, &gsc->v4l2_dev);
 	if (ret)
 		goto err_clk;

+	ret = gsc_register_m2m_device(gsc);
+	if (ret)
+		goto err_v4l2;
 	platform_set_drvdata(pdev, gsc);
 	ret = pm_runtime_get_sync(&pdev->dev);
@@ -1146,6 +1150,8 @@ err_pm:
+	v4l2_device_unregister(&gsc->v4l2_dev);
 	return ret;
@@ -1156,6 +1162,7 @@ static int gsc_remove(struct platform_device *pdev)
 	struct gsc_dev *gsc = platform_get_drvdata(pdev);

+	v4l2_device_unregister(&gsc->v4l2_dev);

diff --git a/drivers/media/platform/exynos-gsc/gsc-core.h b/drivers/media/platform/exynos-gsc/gsc-core.h
index 5f157ef..a1b4148 100644
--- a/drivers/media/platform/exynos-gsc/gsc-core.h
+++ b/drivers/media/platform/exynos-gsc/gsc-core.h
@@ -343,6 +343,7 @@ struct gsc_dev {
 	unsigned long			state;
 	struct vb2_alloc_ctx		*alloc_ctx;
 	struct video_device		vdev;
+	struct v4l2_device		v4l2_dev;

diff --git a/drivers/media/platform/exynos-gsc/gsc-m2m.c b/drivers/media/platform/exynos-gsc/gsc-m2m.c
index c267c57..a11be54 100644
--- a/drivers/media/platform/exynos-gsc/gsc-m2m.c
+++ b/drivers/media/platform/exynos-gsc/gsc-m2m.c
@@ -732,6 +732,7 @@ int gsc_register_m2m_device(struct gsc_dev *gsc)
 	gsc->vdev.release	= video_device_release_empty;
 	gsc->vdev.lock		= &gsc->lock;
 	gsc->vdev.vfl_dir	= VFL_DIR_M2M;
+	gsc->vdev.v4l2_dev	= &gsc->v4l2_dev;
 	snprintf(gsc->vdev.name, sizeof(gsc->vdev.name), "%s.%d:m2m",
 					GSC_MODULE_NAME, gsc->id);


More information about the kernel-team mailing list