ASoC: samsung: i2s: Simplify pri_dai, sec_dai pointers usage 34/200634/2
authorSylwester Nawrocki <s.nawrocki@samsung.com>
Thu, 14 Feb 2019 09:37:44 +0000 (10:37 +0100)
committerSylwester Nawrocki <s.nawrocki@samsung.com>
Mon, 4 Mar 2019 17:05:33 +0000 (18:05 +0100)
If the probe call is on the primary DAI we can use 'other' in place of
i2s->sec_dai, if the probe call is on the secondary DAI we can use 'i2s'
in place of other->sec_dai.

While at it fix one whitespace issue.

Change-Id: Idbe9190d87f628f4d8fab77dbdbe433c8cd7825d
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/samsung/i2s.c

index c446e07..79965fc 100644 (file)
@@ -1056,18 +1056,17 @@ static int samsung_i2s_dai_probe(struct snd_soc_dai *dai)
        pm_runtime_get_sync(dai->dev);
 
        if (is_secondary(i2s)) { /* If this is probe on the secondary DAI */
-               snd_soc_dai_init_dma_data(dai, &other->sec_dai->dma_playback,
-                                          NULL);
+               snd_soc_dai_init_dma_data(dai, &i2s->dma_playback, NULL);
        } else {
                snd_soc_dai_init_dma_data(dai, &i2s->dma_playback,
-                                          &i2s->dma_capture);
+                                         &i2s->dma_capture);
 
                if (priv->quirks & QUIRK_NEED_RSTCLR)
                        writel(CON_RSTCLR, priv->addr + I2SCON);
 
                if (priv->quirks & QUIRK_SUPPORTS_IDMA)
                        idma_reg_addr_init(priv->addr,
-                                       i2s->sec_dai->idma_playback.addr);
+                                          other->idma_playback.addr);
        }
 
        /* Reset any constraint on RFS and BFS */