提交 ff732d28 编写于 作者: L Laurent Pinchart 提交者: Mauro Carvalho Chehab

[media] media: Initialize the media core with subsys_initcall()

Media-related drivers living outside drivers/media/ (such as the UVC
gadget driver in drivers/usb/gadget/) rely on the media core being
initialized before they're probed. As drivers/usb/ is linked before
drivers/media/, this is currently not the case and will lead to crashes
if the drivers are not compiled as modules.

Register media_devnode_init() as a subsys_initcall() instead of
module_init() to fix this.
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: NBhupesh Sharma <bhupesh.sharma@st.com>
Acked-by: NSakari Ailus <sakari.ailus@iki.fi>
Tested-by: NSakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ee981c6f
......@@ -312,7 +312,7 @@ static void __exit media_devnode_exit(void)
unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES);
}
module_init(media_devnode_init)
subsys_initcall(media_devnode_init);
module_exit(media_devnode_exit)
MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册