diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-30 13:30:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-30 13:30:26 -0400 |
commit | 4adc6b9382d5a2c1f39fa44b1e6ff29467e844e5 (patch) | |
tree | 0d06384a369bee0e16fdd3e56557fc75084dd0d3 | |
parent | 86c3e00afd64a507aef954cd581547f28807e51a (diff) | |
parent | d94815f917da770d42c377786dc428f542e38f71 (diff) |
Merge tag 'sound-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Two last-minute HD-audio fixes"
* tag 'sound-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
ALSA: hda - Fix endless loop of codec configure
ALSA: hda - set input_path bitmap to zero after moving it to new place
-rw-r--r-- | sound/pci/hda/hda_codec.h | 2 | ||||
-rw-r--r-- | sound/pci/hda/hda_controller.c | 8 | ||||
-rw-r--r-- | sound/pci/hda/hda_generic.c | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index d6fb2d5d01a7..60ce1cfc300f 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -295,6 +295,8 @@ struct hda_codec { | |||
295 | 295 | ||
296 | #define list_for_each_codec(c, bus) \ | 296 | #define list_for_each_codec(c, bus) \ |
297 | list_for_each_entry(c, &(bus)->core.codec_list, core.list) | 297 | list_for_each_entry(c, &(bus)->core.codec_list, core.list) |
298 | #define list_for_each_codec_safe(c, n, bus) \ | ||
299 | list_for_each_entry_safe(c, n, &(bus)->core.codec_list, core.list) | ||
298 | 300 | ||
299 | /* snd_hda_codec_read/write optional flags */ | 301 | /* snd_hda_codec_read/write optional flags */ |
300 | #define HDA_RW_NO_RESPONSE_FALLBACK (1 << 0) | 302 | #define HDA_RW_NO_RESPONSE_FALLBACK (1 << 0) |
diff --git a/sound/pci/hda/hda_controller.c b/sound/pci/hda/hda_controller.c index 3715a5725613..1c60beb5b70a 100644 --- a/sound/pci/hda/hda_controller.c +++ b/sound/pci/hda/hda_controller.c | |||
@@ -1337,8 +1337,12 @@ EXPORT_SYMBOL_GPL(azx_probe_codecs); | |||
1337 | /* configure each codec instance */ | 1337 | /* configure each codec instance */ |
1338 | int azx_codec_configure(struct azx *chip) | 1338 | int azx_codec_configure(struct azx *chip) |
1339 | { | 1339 | { |
1340 | struct hda_codec *codec; | 1340 | struct hda_codec *codec, *next; |
1341 | list_for_each_codec(codec, &chip->bus) { | 1341 | |
1342 | /* use _safe version here since snd_hda_codec_configure() deregisters | ||
1343 | * the device upon error and deletes itself from the bus list. | ||
1344 | */ | ||
1345 | list_for_each_codec_safe(codec, next, &chip->bus) { | ||
1342 | snd_hda_codec_configure(codec); | 1346 | snd_hda_codec_configure(codec); |
1343 | } | 1347 | } |
1344 | return 0; | 1348 | return 0; |
diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c index 2842c82363c0..71545b56b4c8 100644 --- a/sound/pci/hda/hda_generic.c +++ b/sound/pci/hda/hda_generic.c | |||
@@ -3174,6 +3174,7 @@ static int check_dyn_adc_switch(struct hda_codec *codec) | |||
3174 | spec->input_paths[i][nums]); | 3174 | spec->input_paths[i][nums]); |
3175 | spec->input_paths[i][nums] = | 3175 | spec->input_paths[i][nums] = |
3176 | spec->input_paths[i][n]; | 3176 | spec->input_paths[i][n]; |
3177 | spec->input_paths[i][n] = 0; | ||
3177 | } | 3178 | } |
3178 | } | 3179 | } |
3179 | nums++; | 3180 | nums++; |