diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-03-12 09:02:47 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-03-19 18:02:22 -0400 |
commit | ff732d281b29ad7898c1193843ebe6a37d426e36 (patch) | |
tree | 25424dfa90201d53c742dbf56124d657c1f6e282 /drivers/media/media-devnode.c | |
parent | ee981c6fac6724c3730102c0905af1bc1c99f722 (diff) |
[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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Bhupesh Sharma <bhupesh.sharma@st.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Tested-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/media-devnode.c')
-rw-r--r-- | drivers/media/media-devnode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index 7b42ace419d9..421cf73858d3 100644 --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c | |||
@@ -312,7 +312,7 @@ static void __exit media_devnode_exit(void) | |||
312 | unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES); | 312 | unregister_chrdev_region(media_dev_t, MEDIA_NUM_DEVICES); |
313 | } | 313 | } |
314 | 314 | ||
315 | module_init(media_devnode_init) | 315 | subsys_initcall(media_devnode_init); |
316 | module_exit(media_devnode_exit) | 316 | module_exit(media_devnode_exit) |
317 | 317 | ||
318 | MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); | 318 | MODULE_AUTHOR("Laurent Pinchart <laurent.pinchart@ideasonboard.com>"); |