Skip to content

Commit 1d9d780

Browse files
Arun Kumar Kgregkh
Arun Kumar K
authored andcommitted
media: exynos-gsc: Register v4l2 device
commit d0b1c31 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 1c1d86a [media] v4l2: always require v4l2_dev, rename parent to dev_parent Signed-off-by: Arun Kumar K <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5f24e18 commit 1d9d780

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

drivers/media/platform/exynos-gsc/gsc-core.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,10 +1122,14 @@ static int gsc_probe(struct platform_device *pdev)
11221122
goto err_clk;
11231123
}
11241124

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

1129+
ret = gsc_register_m2m_device(gsc);
1130+
if (ret)
1131+
goto err_v4l2;
1132+
11291133
platform_set_drvdata(pdev, gsc);
11301134
pm_runtime_enable(dev);
11311135
ret = pm_runtime_get_sync(&pdev->dev);
@@ -1147,6 +1151,8 @@ static int gsc_probe(struct platform_device *pdev)
11471151
pm_runtime_put(dev);
11481152
err_m2m:
11491153
gsc_unregister_m2m_device(gsc);
1154+
err_v4l2:
1155+
v4l2_device_unregister(&gsc->v4l2_dev);
11501156
err_clk:
11511157
gsc_clk_put(gsc);
11521158
return ret;
@@ -1157,6 +1163,7 @@ static int gsc_remove(struct platform_device *pdev)
11571163
struct gsc_dev *gsc = platform_get_drvdata(pdev);
11581164

11591165
gsc_unregister_m2m_device(gsc);
1166+
v4l2_device_unregister(&gsc->v4l2_dev);
11601167

11611168
vb2_dma_contig_cleanup_ctx(gsc->alloc_ctx);
11621169
pm_runtime_disable(&pdev->dev);

drivers/media/platform/exynos-gsc/gsc-core.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ struct gsc_dev {
343343
unsigned long state;
344344
struct vb2_alloc_ctx *alloc_ctx;
345345
struct video_device vdev;
346+
struct v4l2_device v4l2_dev;
346347
};
347348

348349
/**

drivers/media/platform/exynos-gsc/gsc-m2m.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,7 @@ int gsc_register_m2m_device(struct gsc_dev *gsc)
751751
gsc->vdev.release = video_device_release_empty;
752752
gsc->vdev.lock = &gsc->lock;
753753
gsc->vdev.vfl_dir = VFL_DIR_M2M;
754+
gsc->vdev.v4l2_dev = &gsc->v4l2_dev;
754755
snprintf(gsc->vdev.name, sizeof(gsc->vdev.name), "%s.%d:m2m",
755756
GSC_MODULE_NAME, gsc->id);
756757

0 commit comments

Comments
 (0)