]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: dapm: Fix regression introducing multiple copies of DAI widgets
authorCharles Keepax <ckeepax@opensource.cirrus.com>
Thu, 9 Apr 2020 18:12:07 +0000 (19:12 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 14 Apr 2020 11:16:23 +0000 (12:16 +0100)
commit64d6836192108146111cf05b755572a1f4e21d7d
tree2b27088c0b5fdf03f0e56a2c9cd29a03a731f438
parente51ffe6934223a1f1ae1fddf0f3462f30874c919
ASoC: dapm: Fix regression introducing multiple copies of DAI widgets

Refactoring was done to factor out the linking of DAI widgets into
a helper function, dapm_add_valid_dai_widget. However when this was
done, a regression was introduced for CODEC to CODEC links. It was
over looked that the playback and capture variables persisted across
all CODEC DAIs being processed, which ensured that the special DAI
widget that is added for CODEC to CODEC links was only created once.
This bug causes kernel panics during DAPM shutdown.

To stick with the spirit of the original refactoring whilst fixing the
issue, variables to hold the DAI widgets are added to snd_soc_dai_link.
Furthermore the dapm_add_valid_dai_widget function is renamed to
dapm_connect_dai_pair, the function only adds DAI widgets in the CODEC
to CODEC case and its primary job is to add routes connecting two DAI
widgets, making the original name quite misleading.

Fixes: d5d36374f156 ("ASoC: Add dapm_add_valid_dai_widget helper")
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20200409181209.30130-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc.h
sound/soc/soc-dapm.c