From: Jerome Brunet Date: Wed, 15 May 2019 13:18:55 +0000 (+0200) Subject: ASoC: dapm: allow muxes to force a disconnect X-Git-Tag: v5.15~5427^2~39^2~469 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c3456a4b2142550944f73a87a8f338074508b249;p=platform%2Fkernel%2Flinux-starfive.git ASoC: dapm: allow muxes to force a disconnect Let soc_dapm_mux_update_power() accept NULL as 'e' enum. It makes the code a bit more robust and, more importantly, let the calling mux force a disconnect of the output path if necessary. This is useful if the dapm elements following the mux must be off while updating the mux, to avoid glitches or force a (re)configuration. Signed-off-by: Jerome Brunet Tested-by: Neil Armstrong Tested-by: Kevin Hilman Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 81a7a12..a4d6c06 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -2245,7 +2245,7 @@ static int soc_dapm_mux_update_power(struct snd_soc_card *card, dapm_kcontrol_for_each_path(path, kcontrol) { found = 1; /* we now need to match the string in the enum to the path */ - if (!(strcmp(path->name, e->texts[mux]))) + if (e && !(strcmp(path->name, e->texts[mux]))) connect = true; else connect = false;