summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
09e88f8)
Current soc-pcm is using bit-OR'ed error
ret |= snd_soc_component_close(component, substream);
ret |= snd_soc_component_hw_free(component, substream);
The driver may return arbitrary error codes so they can conflict.
The bit-OR'ed error works only if the return code is always consistent.
This patch fixup it, and use *last* ret value.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/877e0vceyc.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
- ret |= snd_soc_component_close(component, substream);
+ r = snd_soc_component_close(component, substream);
+ if (r < 0)
+ ret = r; /* use last ret */
+
snd_soc_component_module_put_when_close(component);
}
snd_soc_component_module_put_when_close(component);
}
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
for_each_rtd_components(rtd, i, component) {
if (component == last)
break;
- ret |= snd_soc_component_hw_free(component, substream);
+ r = snd_soc_component_hw_free(component, substream);
+ if (r < 0)
+ ret = r; /* use last ret */