From b0c4680557b92bef6a7c338b4f995ecf0483362c Mon Sep 17 00:00:00 2001 From: Ahung Cheng Date: Tue, 16 Jan 2018 16:41:17 +0800 Subject: media: tegra: allocate video_device dynamically Using initialized static video_device for video_register_device during sensor re-bind will cause panic with following log. ----------- kobject (ffffffc0794d70c0): tried to init an initialized object, something is seriously wrong. ----------- Hence, modify vi driver to use dynamic video_device bug 2015230 bug 2719996 Change-Id: Ia7bfb5621e34b54a079c45b3f9aafeaa06407515 Reviewed-on: https://git-master.nvidia.com/r/1639229 Signed-off-by: Frank Chen (cherry picked from commit 39b1a64a8ee9e40cd4f1a99c2d936e3310e5e8b9) Reviewed-on: https://git-master.nvidia.com/r/2208308 GVS: Gerrit_Virtual_Submit Reviewed-by: Shan Neng Chen Reviewed-by: Sudhir Vyas Reviewed-by: mobile promotions Tested-by: mobile promotions --- include/media/mc_common.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/media/mc_common.h b/include/media/mc_common.h index f126ca798..01b034539 100644 --- a/include/media/mc_common.h +++ b/include/media/mc_common.h @@ -152,7 +152,7 @@ struct tegra_vi_graph_entity { struct tegra_channel { int id; struct list_head list; - struct video_device video; + struct video_device *video; struct media_pad pad; struct media_pipeline pipe; struct mutex video_lock; @@ -396,6 +396,9 @@ void enqueue_inflight(struct tegra_channel *chan, struct tegra_channel_buffer *dequeue_inflight(struct tegra_channel *chan); int tegra_channel_set_power(struct tegra_channel *chan, bool on); +int tegra_channel_init_video(struct tegra_channel *chan); +int tegra_channel_cleanup_video(struct tegra_channel *chan); + struct tegra_vi_fops { int (*vi_power_on)(struct tegra_channel *chan); void (*vi_power_off)(struct tegra_channel *chan); -- cgit v1.2.2