[alsa-devel] [PATCH 5/7] ASoC: soc-pcm: goto error after trying all component open
Kuninori Morimoto
kuninori.morimoto.gx at renesas.com
Tue Jan 28 01:31:52 CET 2020
Hi Sridharan
Thank you for your feedback
> @@ -463,47 +463,32 @@ static void soc_pcm_init_runtime_hw(struct snd_pcm_substream *substream)
> hw->rate_max = min_not_zero(hw->rate_max, rate_max);
> }
>
> -static int soc_pcm_components_open(struct snd_pcm_substream *substream,
> - struct snd_soc_component **last)
> +static int soc_pcm_components_open(struct snd_pcm_substream *substream)
> {
> struct snd_soc_pcm_runtime *rtd = substream->private_data;
> struct snd_soc_component *component;
> int i, ret = 0;
>
> for_each_rtd_components(rtd, i, component) {
> - *last = component;
> + ret |= snd_soc_component_module_get_when_open(component);
> + ret |= snd_soc_component_open(component, substream);
> + }
>
> - ret = snd_soc_component_module_get_when_open(component);
> - if (ret < 0) {
> - dev_err(component->dev,
> - "ASoC: can't get module %s\n",
> - component->name);
> - return ret;
> - }
> + if (ret < 0)
> + dev_err(component->dev,
> + "ASoC: error happen during open component %s: %d\n",
> + component->name, ret);
>
> Hi Morimoto-san,
>
> Wouldn't the component here always be the last component in the list of rtd components? Should this error log be moved inside
> the for_each_rtd_components() {} above?
Yeah, indeed.
Will fix
Thank you for your help !!
Best regards
---
Kuninori Morimoto
More information about the Alsa-devel
mailing list