aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-06-28 06:45:34 -0400
committerTakashi Iwai <tiwai@suse.de>2017-06-28 06:45:34 -0400
commit17890880bbf7bac8171054c7dca7a5162b23c5c2 (patch)
treecc1103f6e79fc2f3058c97a5050b1a68f849a035
parentd94815f917da770d42c377786dc428f542e38f71 (diff)
ALSA: hda - Skip card registration when no codec is found
It's nonsense to register a card object when no codec is bound on it, as we don't support the deferred codec binding. Instead of registering an empty card object, just skip the registration by returning an error from azx_codec_configure(). Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_controller.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 1c60beb5b70a..d1eb14842340 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -1345,6 +1345,9 @@ int azx_codec_configure(struct azx *chip)
1345 list_for_each_codec_safe(codec, next, &chip->bus) { 1345 list_for_each_codec_safe(codec, next, &chip->bus) {
1346 snd_hda_codec_configure(codec); 1346 snd_hda_codec_configure(codec);
1347 } 1347 }
1348
1349 if (!azx_bus(chip)->num_codecs)
1350 return -ENODEV;
1348 return 0; 1351 return 0;
1349} 1352}
1350EXPORT_SYMBOL_GPL(azx_codec_configure); 1353EXPORT_SYMBOL_GPL(azx_codec_configure);