]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: dapm: Don't add prefix to widget stream name
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 21 Jul 2015 09:51:35 +0000 (11:51 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 21 Jul 2015 10:32:00 +0000 (11:32 +0100)
commit69c937c974a8a34f9207606229a0dfb9267931bf
tree54e4ba2ca2cb4defa12f305e9ed32d12db1a59c7
parent1d5c27fe471ef537c06f5a6d874d4688193aca8a
ASoC: dapm: Don't add prefix to widget stream name

Commit 0baf46f439ba ("ASoC: dapm: Modify widget stream name according to
prefix") fixed the case where a DAPM route between a DAI widget and a
DAC/ADC/AIF widget with a matching stream name was not created when the
DAPM context was using a prefix.

Unfortunately the patch introduced a few issues on its own like leaking the
dynamically allocated stream name memory and also not checking whether the
allocation succeeded in the first place.

It is also incomplete in that it still does not handle the case where
stream name of the widget is a substring of the stream name of the DAI,
which is explicitly allowed and works fine if no DAPM prefix is used.

Revert the commit and take a slightly different approach to solving the
issue. Instead of comparing the widget's stream name to the name of the DAI
widget compare it to the stream name of the DAI widget. The stream name of
the DAI widget is identical to the name of the DAI widget except that it
wont have the DAPM prefix added. So this approach behaves identical
regardless to whether the DAPM context uses a prefix or not.

We don't have to worry about potentially matching with a widget with the
same stream name, but from a different DAPM context with a different
prefix, since the code already makes sure that both the DAI widget and the
matched widget are from the same DAPM context.

Fixes: 0baf46f439ba ("ASoC: dapm: Modify widget stream name according to prefix")
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
sound/soc/soc-dapm.c