summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sound/soc/soc-pcm.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 7a490c05d4e9..8d8ed4774e9c 100644
--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -498,13 +498,16 @@ static int soc_pcm_components_close(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
- int i, ret = 0;
+ int i, r, ret = 0;
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);
}
@@ -798,13 +801,15 @@ static int soc_pcm_components_hw_free(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_component *component;
- int i, ret = 0;
+ int i, r, ret = 0;
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 */
}
return ret;