Re: [PATCH v4 15/23] ASoC: soc-core: Identify 'no_pcm' DAI links for DPCM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Sameer

> PCM devices are created for dai links with 'no-pcm' flag as '0'.
> Such DAI links have CPU component which implement pcm_construct()
> and pcm_destruct() callbacks. Based on this, current patch exposes
> a helper function to identify such components and populate 'no_pcm'
> flag for DPCM DAI link.
(snip)
> +bool soc_component_is_pcm(struct snd_soc_dai_link_component *dlc)
> +{
> +	struct snd_soc_component *component;
> +	struct snd_soc_dai *dai;
> +
> +	for_each_component(component) {
> +		if (!component->driver)
> +			continue;
> +
> +		for_each_component_dais(component, dai) {
> +			if (!dai->name || !dlc->dai_name)
> +				continue;
> +
> +			if (strcmp(dai->name, dlc->dai_name))
> +				continue;


We can/should NULL poinster check for "dlc->dai_name" on top of
this function instead of inside loop ?
And then, we can remove "dai->name" check because next strcmp()
automatically fail if dai->name was NULL.

Thank you for your help !!

Best regards
---
Kuninori Morimoto



[Index of Archives]     [ARM Kernel]     [Linux ARM]     [Linux ARM MSM]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux