aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-02 14:35:27 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-02 16:11:33 -0400
commit6ae5e060840589f567c1837613e8a9d34fc9188a (patch)
treeebe0f5e0dd0faab3499ac0a6abe24c8f41d8780e /drivers/media/usb
parent351d18786e1fa45d1cd20bad03e445dbb50e0912 (diff)
em28xx: Make all em28xx extensions to be initialized asynchronously
em28xx-dvb, em28xx-alsa and em28xx-ir are typically initialized asyncrhronously. The exception for it is when those modules are loaded before em28xx (or before an em28xx card insertion) or when they're built in. Make the extentions to always load asynchronously. That allows having all DVB firmwares loaded synchronously with udev-182. Antti tested it with the following hardware: Hauppauge WinTV HVR 930C MaxMedia UB425-TC PCTV QuatroStick nano (520e) Tested-by: Antti Palosaari <crope@iki.fi> Cc: stable@kernel.org # for Kernel 3.6 - please note that driver location has changed Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb')
-rw-r--r--drivers/media/usb/em28xx/em28xx-cards.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c
index ca62b9981380..ab98d0845861 100644
--- a/drivers/media/usb/em28xx/em28xx-cards.c
+++ b/drivers/media/usb/em28xx/em28xx-cards.c
@@ -2875,12 +2875,20 @@ static void em28xx_card_setup(struct em28xx *dev)
2875} 2875}
2876 2876
2877 2877
2878#if defined(CONFIG_MODULES) && defined(MODULE)
2879static void request_module_async(struct work_struct *work) 2878static void request_module_async(struct work_struct *work)
2880{ 2879{
2881 struct em28xx *dev = container_of(work, 2880 struct em28xx *dev = container_of(work,
2882 struct em28xx, request_module_wk); 2881 struct em28xx, request_module_wk);
2883 2882
2883 /*
2884 * The em28xx extensions can be modules or builtin. If the
2885 * modules are already loaded or are built in, those extensions
2886 * can be initialised right now. Otherwise, the module init
2887 * code will do it.
2888 */
2889 em28xx_init_extension(dev);
2890
2891#if defined(CONFIG_MODULES) && defined(MODULE)
2884 if (dev->has_audio_class) 2892 if (dev->has_audio_class)
2885 request_module("snd-usb-audio"); 2893 request_module("snd-usb-audio");
2886 else if (dev->has_alsa_audio) 2894 else if (dev->has_alsa_audio)
@@ -2890,6 +2898,7 @@ static void request_module_async(struct work_struct *work)
2890 request_module("em28xx-dvb"); 2898 request_module("em28xx-dvb");
2891 if (dev->board.ir_codes && !disable_ir) 2899 if (dev->board.ir_codes && !disable_ir)
2892 request_module("em28xx-rc"); 2900 request_module("em28xx-rc");
2901#endif /* CONFIG_MODULES */
2893} 2902}
2894 2903
2895static void request_modules(struct em28xx *dev) 2904static void request_modules(struct em28xx *dev)
@@ -2902,10 +2911,6 @@ static void flush_request_modules(struct em28xx *dev)
2902{ 2911{
2903 flush_work_sync(&dev->request_module_wk); 2912 flush_work_sync(&dev->request_module_wk);
2904} 2913}
2905#else
2906#define request_modules(dev)
2907#define flush_request_modules(dev)
2908#endif /* CONFIG_MODULES */
2909 2914
2910/* 2915/*
2911 * em28xx_release_resources() 2916 * em28xx_release_resources()
@@ -3324,13 +3329,6 @@ static int em28xx_usb_probe(struct usb_interface *interface,
3324 */ 3329 */
3325 mutex_unlock(&dev->lock); 3330 mutex_unlock(&dev->lock);
3326 3331
3327 /*
3328 * These extensions can be modules. If the modules are already
3329 * loaded then we can initialise the device now, otherwise we
3330 * will initialise it when the modules load instead.
3331 */
3332 em28xx_init_extension(dev);
3333
3334 return 0; 3332 return 0;
3335 3333
3336unlock_and_free: 3334unlock_and_free: