]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: Make soc_component_read() returning an error code again
authorTakashi Iwai <tiwai@suse.de>
Mon, 10 Aug 2020 13:46:31 +0000 (15:46 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 11 Aug 2020 13:05:46 +0000 (14:05 +0100)
commitf172a8b7aaf88f52b30e803961e1ac6cb84f9e96
treede0fb491ca7ebe557c3a34b4532650acc352a63a
parenteaba8d5e688d60e9376315fd4c6646a9b80c16ab
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: d9744068f344 ("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>
sound/soc/soc-component.c