[alsa-devel] [PATCH 24/25] ASoC: soc-component: move snd_soc_component_stream_event()

Charles Keepax ckeepax at opensource.cirrus.com
Wed Jul 24 11:37:47 CEST 2019


On Wed, Jul 24, 2019 at 10:53:37AM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> 
> This patch moves snd_soc_component_stream_event() to soc-component.c
> It will be used at soc-dapm.c :: dapm_power_widgets(),
> but no effect by this patch.
> 
> 	static int dapm_power_widgets(struct snd_soc_card *card, int event)
> 	{
> 		...
> 		list_for_each_entry(d, &card->dapm_list, list) {
> =>			if (d->stream_event)
> =>				d->stream_event(d, event);
> 		}
> 		...
> 	}
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
> ---
> diff --git a/sound/soc/soc-component.c b/sound/soc/soc-component.c
> index e4e8fc4..ab8e7cc 100644
> --- a/sound/soc/soc-component.c
> +++ b/sound/soc/soc-component.c
> @@ -61,6 +61,16 @@ void snd_soc_component_seq_notifier(struct snd_soc_dapm_context *dapm,
>  		component->driver->seq_notifier(component, type, subseq);
>  }
>  
> +int snd_soc_component_stream_event(struct snd_soc_dapm_context *dapm,
> +				   int event)
> +{
> +	struct snd_soc_component *component = dapm->component;
> +
> +	if (component->driver->stream_event)
> +		return component->driver->stream_event(component, event);
> +	return 0;

Minor nitpick but a blank line before the return would be more
normal and consistent with your other patches.

> @@ -2729,8 +2721,7 @@ static int snd_soc_component_initialize(struct snd_soc_component *component,
>  	dapm->idle_bias_off = !driver->idle_bias_on;
>  	dapm->suspend_bias_off = driver->suspend_bias_off;
>  	dapm->seq_notifier = snd_soc_component_seq_notifier;
> -	if (driver->stream_event)
> -		dapm->stream_event = snd_soc_component_stream_event;
> +	dapm->stream_event = snd_soc_component_stream_event;

Obviously same comment regarding the NULL checks in DAPM applies
here.

Thanks,
Charles


More information about the Alsa-devel mailing list