aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/sound/soc/soc-component.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2020-08-10 15:46:31 +0200
committerMark Brown <broonie@kernel.org>2020-08-11 14:05:46 +0100
commitefc913c8fb88728626759735e1b09370a6813180 (patch)
treede0fb491ca7ebe557c3a34b4532650acc352a63a /sound/soc/soc-component.c
parentASoC: amd: Replacing component->name with codec_dai->name. (diff)
downloadwireguard-linux-efc913c8fb88728626759735e1b09370a6813180.tar.xz
wireguard-linux-efc913c8fb88728626759735e1b09370a6813180.zip
ASoC: Make soc_component_read() returning an error code again
Along with the recent unification of snd_soc_component_read*() functions, the behavior of snd_soc_component_read() was changed slightly; namely it returns the register read value directly, and even if an error happens, it returns zero (but it prints an error message). That said, the caller side can't know whether it's an error or not any longer. Ideally this shouldn't matter much, but in practice this seems causing a regression, as John reported. And, grepping the tree revealed that there are still plenty of callers that do check the error code, so we'll need to deal with them in anyway. As a quick band-aid over the regression, this patch changes the return value of snd_soc_component_read() again to the negative error code. It can't work, obviously, for 32bit register values, but it should be enough for the known regressions, so far. Fixes: cf6e26c71bfd ("ASoC: soc-component: merge snd_soc_component_read() and snd_soc_component_read32()") Reported-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/20200810134631.19742-1-tiwai@suse.de Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-component.c')
-rw-r--r--sound/soc/soc-component.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
index f0b4f4bc44a4..5504b92946e3 100644
--- a/sound/soc/soc-component.c
+++ b/sound/soc/soc-component.c
@@ -406,7 +406,7 @@ static unsigned int soc_component_read_no_lock(
ret = -EIO;
if (ret < 0)
- soc_component_ret(component, ret);
+ return soc_component_ret(component, ret);
return val;
}