diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-02-28 13:42:09 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-02-28 14:02:21 +0100 |
commit | d604b3990884062873e3bef09ef5e89857c409c3 (patch) | |
tree | 2bb427552257ef1404ac61bb67e212b611fe92ea /sound/pci/hda/patch_conexant.c | |
parent | 2b9e4a73fbd90cb8459cf84c12ae05d2eb81da41 (diff) |
ALSA: hda - Fix registration of beep input device
The beep input device is registered via input_register_device(), but
this is called in snd_hda_attach_beep_device() where the sound devices
aren't registered yet. This leads to the binding to non-existing
object, thus results in failure. And, even if the binding worked
(against the PCI object), it's still racy; the input device appears
before the sound objects.
For fixing this, register the input device properly at dev_register
ops of the codec object it's bound with. Also, call
snd_hda_detach_beep_device() at dev_disconnection so that it's
detached at the right timing. As a bonus, since it's called in the
codec's ops, we can get rid of the further call from the other codec
drivers.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/patch_conexant.c')
-rw-r--r-- | sound/pci/hda/patch_conexant.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 09d6d0db2b06..1dc7e974f3b1 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c @@ -445,9 +445,7 @@ static int conexant_init(struct hda_codec *codec) static void conexant_free(struct hda_codec *codec) { - struct conexant_spec *spec = codec->spec; - snd_hda_detach_beep_device(codec); - kfree(spec); + kfree(codec->spec); } static const struct snd_kcontrol_new cxt_capture_mixers[] = { |