Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit d2e24d64 authored by Kuninori Morimoto's avatar Kuninori Morimoto Committed by Mark Brown
Browse files

ASoC: add for_each_dpcm_fe() macro



To be more readable code, this patch adds
new for_each_dpcm_fe() macro, and replace existing code to it.

Signed-off-by: default avatarKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1a1035a9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -103,6 +103,9 @@ struct snd_soc_dpcm_runtime {
	int trigger_pending; /* trigger cmd + 1 if pending, 0 if not */
};

#define for_each_dpcm_fe(be, stream, dpcm)				\
	list_for_each_entry(dpcm, &(be)->dpcm[stream].fe_clients, list_fe)

/* can this BE stop and free */
int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
		struct snd_soc_pcm_runtime *be, int stream);
+3 −3
Original line number Diff line number Diff line
@@ -1252,7 +1252,7 @@ static void dpcm_be_reparent(struct snd_soc_pcm_runtime *fe,

	be_substream = snd_soc_dpcm_get_substream(be, stream);

	list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) {
	for_each_dpcm_fe(be, stream, dpcm) {
		if (dpcm->fe == fe)
			continue;

@@ -3219,7 +3219,7 @@ int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
	struct snd_soc_dpcm *dpcm;
	int state;

	list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) {
	for_each_dpcm_fe(be, stream, dpcm) {

		if (dpcm->fe == fe)
			continue;
@@ -3246,7 +3246,7 @@ int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
	struct snd_soc_dpcm *dpcm;
	int state;

	list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) {
	for_each_dpcm_fe(be, stream, dpcm) {

		if (dpcm->fe == fe)
			continue;