]> 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)
commit2434eeabea887eb73ff70e129077a529d47eca9c
tree2b27088c0b5fdf03f0e56a2c9cd29a03a731f438
parentcd75ef082572c77234769d65dbdd1a24a7f84f86
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: 1197aca7bb10 ("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