]> xenbits.xensource.com Git - arm/linux.git/commitdiff
ASoC: add for_each_dpcm_fe() macro
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 18 Sep 2018 01:30:54 +0000 (01:30 +0000)
committerMark Brown <broonie@kernel.org>
Thu, 20 Sep 2018 17:31:19 +0000 (10:31 -0700)
To be more readable code, this patch adds
new for_each_dpcm_fe() macro, and replace existing code to it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-dpcm.h
sound/soc/soc-pcm.c

index 9bb92f187af87a3f8d7196c7580320792af35137..f130de6cfe8e6c938346dc6272d1d002018d9e0e 100644 (file)
@@ -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);
index 09d0f668c78e6dd3da9a4a0aec2c8b1c242e435e..e7916630e6fadd03e89c124b825f5ad715c55a9b 100644 (file)
@@ -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;