diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-06-28 17:42:50 +0300 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-06-28 17:42:50 +0300 |
commit | 4032da5ffe266fc781a15bd7b24295c433002ab5 (patch) | |
tree | bd92a7153328b25dae2e153854ea8cf4c3fb23b5 /sound/pci/hda/hda_controller.c | |
parent | f03293d8fc97f07dbe4c54ce495c8dac172dc6e1 (diff) | |
parent | 43f6c8d97bbdc05858b3d64e4c683821ce46c2db (diff) | |
download | linux-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.c | 11 |
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); |