summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_controller.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2017-06-28 17:42:50 +0300
committerTakashi Iwai <tiwai@suse.de>2017-06-28 17:42:50 +0300
commit4032da5ffe266fc781a15bd7b24295c433002ab5 (patch)
treebd92a7153328b25dae2e153854ea8cf4c3fb23b5 /sound/pci/hda/hda_controller.c
parentf03293d8fc97f07dbe4c54ce495c8dac172dc6e1 (diff)
parent43f6c8d97bbdc05858b3d64e4c683821ce46c2db (diff)
downloadlinux-4032da5ffe266fc781a15bd7b24295c433002ab5.tar.xz
Merge branch 'topic/hda-fix' into for-next
Diffstat (limited to 'sound/pci/hda/hda_controller.c')
-rw-r--r--sound/pci/hda/hda_controller.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c
index 3715a5725613..d1eb14842340 100644
--- a/sound/pci/hda/hda_controller.c
+++ b/sound/pci/hda/hda_controller.c
@@ -1337,10 +1337,17 @@ EXPORT_SYMBOL_GPL(azx_probe_codecs);
/* configure each codec instance */
int azx_codec_configure(struct azx *chip)
{
- struct hda_codec *codec;
- list_for_each_codec(codec, &chip->bus) {
+ struct hda_codec *codec, *next;
+
+ /* use _safe version here since snd_hda_codec_configure() deregisters
+ * the device upon error and deletes itself from the bus list.
+ */
+ list_for_each_codec_safe(codec, next, &chip->bus) {
snd_hda_codec_configure(codec);
}
+
+ if (!azx_bus(chip)->num_codecs)
+ return -ENODEV;
return 0;
}
EXPORT_SYMBOL_GPL(azx_codec_configure);