diff options
author | Charles Keepax <ckeepax@opensource.cirrus.com> | 2022-06-23 11:51:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-06-23 13:07:48 +0100 |
commit | 4d6c2b46d81765e920007f76185a8d1fb5e41ca3 (patch) | |
tree | 69668db2315eda644a654605c72a035647887840 /sound | |
parent | d5017d1323d45db14d1db3d348779264ffce9fb2 (diff) | |
download | linux-4d6c2b46d81765e920007f76185a8d1fb5e41ca3.tar.bz2 |
ASoC: dapm: Move stereo autodisable check
Tidy up the code a little, rather than repeating the check of
mc->autodisable move the stereo error check to be under the
existing if for mc->autodisable.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220623105120.1981154-6-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-dapm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 869c76506b66..62c90e297aab 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -368,14 +368,14 @@ static int dapm_kcontrol_data_alloc(struct snd_soc_dapm_widget *widget, case snd_soc_dapm_mixer_named_ctl: mc = (struct soc_mixer_control *)kcontrol->private_value; - if (mc->autodisable && snd_soc_volsw_is_stereo(mc)) - dev_warn(widget->dapm->dev, - "ASoC: Unsupported stereo autodisable control '%s'\n", - ctrl_name); - if (mc->autodisable) { struct snd_soc_dapm_widget template; + if (snd_soc_volsw_is_stereo(mc)) + dev_warn(widget->dapm->dev, + "ASoC: Unsupported stereo autodisable control '%s'\n", + ctrl_name); + name = kasprintf(GFP_KERNEL, "%s %s", ctrl_name, "Autodisable"); if (!name) { |