Re: [PATCH 07/20] ASoC: soc-pcm.c: cleanup normal connection loop at soc_get_playback_capture() part2

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

 



On 5/18/2023 7:47 AM, Kuninori Morimoto wrote:
soc_get_playback_capture() (A) is handling both DPCM (X) / Normal (Y)
connection.

(A)	static int soc_get_playback_capture(...)
	{
		...
  ^		if (dai_link->dynamic || dai_link->no_pcm) {
(X)			...
  v
  ^		} else {
  |			...
  |			for_each_rtd_codec_dais(rtd, i, codec_dai) {
  |				if (dai_link->num_cpus == 1) {
  |(a)					cpu_dai = ...
(Y)				} else if (dai_link->num_cpus == dai_link->num_codecs) {
  |(b)					cpu_dai = ...
  |				}
  |				...
  |			}
  |			...
  v		}
		...
	}

In Normal connection case (Y), it is checking number of CPU / Codec.
	(a) is for Single CPU case
	(b) is for Multi  CPU case

We can simply merge (a) and (b). Because it is doing
same judgement, same operation.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx>
---

Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@xxxxxxxxxxxxxxx>




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux