[alsa-devel] [PATCH 10/25] ASoC: soc-component: add snd_soc_component_ioctrl()

Kuninori Morimoto kuninori.morimoto.gx at renesas.com
Thu Jul 25 03:51:45 CEST 2019


Hi Charles

> >  	for_each_rtdcom(rtd, rtdcom) {
> >  		component = rtdcom->component;
> >  
> > -		if (!component->driver->ops ||
> > -		    !component->driver->ops->ioctl)
> > -			continue;
> > -
> > +		ret = snd_soc_component_ioctl(component, substream, cmd, arg);
> >  		/* FIXME: use 1st ioctl */
> > -		return component->driver->ops->ioctl(substream, cmd, arg);
> > +		if (ret != -ENOTSUPP)
> > +			return ret;
> 
> This feels a little forced, and also changes behaviour if any
> ioctl callbacks already report -ENOTSUPP.
> 
> I wonder if for some/all of these functions it might be worth
> abstracting them at a higher level so the whole for_each_rtdcom
> loop moves into the helper function similar to what I did with
> compress stuff, for example in these patches:
> 
> 1e57b82891ad ("ASoC: compress: Add helper functions for component open/free")
> 4ef0ecb80e34 ("ASoC: compress: Add helper functions for component trigger/set_params")

Thank you for your feedback.
It sounds nice idea for me.
will fix in v2


Thank you for your help !!
Best regards
---
Kuninori Morimoto


More information about the Alsa-devel mailing list