From: Takashi Iwai <tiwai@suse.de>
Date: Wed, 11 Mar 2015 11:50:15 +0000 (+0100)
Subject: ALSA: seq: Fix init order of snd_seq_device stuff
X-Git-Tag: firefly_0821_release~176^2~1862^2~19^2~43^2~15
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4945f1fdc14ef090abe50d1b5682bfc1e4763c06;p=firefly-linux-kernel-4.4.55.git

ALSA: seq: Fix init order of snd_seq_device stuff

When the sequencer driver is built in kernel, it may panic at boot
because of the uninitialized snd_seq_bus_type.  Initialize it properly
via subsys_initcall() instead of module_init() to assure that the bus
is registered beforehand.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Fixes: 7c37ae5c625a ('ALSA: seq: Rewrite sequencer device binding with standard bus')
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---

diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index 355b34269bd1..d99f99d61983 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -311,5 +311,5 @@ static void __exit alsa_seq_device_exit(void)
 	bus_unregister(&snd_seq_bus_type);
 }
 
-module_init(alsa_seq_device_init)
+subsys_initcall(alsa_seq_device_init)
 module_exit(alsa_seq_device_exit)