ASoC: codecs: use asoc_rtd_to_cpu() / asoc_rtd_to_codec() macro for DAI pointer
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 23 Mar 2020 05:21:56 +0000 (14:21 +0900)
committerMark Brown <broonie@kernel.org>
Fri, 27 Mar 2020 14:44:57 +0000 (14:44 +0000)
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/87wo7bhci3.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs47l15.c
sound/soc/codecs/cs47l24.c
sound/soc/codecs/cs47l35.c
sound/soc/codecs/cs47l85.c
sound/soc/codecs/cs47l90.c
sound/soc/codecs/cs47l92.c
sound/soc/codecs/wm5110.c
sound/soc/codecs/wm_adsp.c

index e8840dc142ef36f25a1dfd7950553317f1224b34..8d1869bf7f9ce4c5e14b7943486d4a8b19b28775 100644 (file)
@@ -1239,12 +1239,12 @@ static int cs47l15_open(struct snd_compr_stream *stream)
        struct madera *madera = priv->madera;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l15-dsp-trace") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l15-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(madera->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index 25bffc2968f039b4837fb15423b86e474af5185a..6b0570f596304bd74573efa759242e54857308b7 100644 (file)
@@ -1076,14 +1076,14 @@ static int cs47l24_open(struct snd_compr_stream *stream)
        struct arizona *arizona = priv->core.arizona;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l24-dsp-voicectrl") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-voicectrl") == 0) {
                n_adsp = 2;
-       } else if (strcmp(rtd->codec_dai->name, "cs47l24-dsp-trace") == 0) {
+       } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l24-dsp-trace") == 0) {
                n_adsp = 1;
        } else {
                dev_err(arizona->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index 3d48a0d9ecc5816264c0e3f9929bee4948599384..18839807c9d15d97aba9562971924c62a67ba403 100644 (file)
@@ -1514,14 +1514,14 @@ static int cs47l35_open(struct snd_compr_stream *stream)
        struct madera *madera = priv->madera;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l35-dsp-voicectrl") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-voicectrl") == 0) {
                n_adsp = 2;
-       } else if (strcmp(rtd->codec_dai->name, "cs47l35-dsp-trace") == 0) {
+       } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l35-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(madera->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index bef3471f482d493f9e885008103e80edc1a9d21b..a575113207f0b90e1fc6a858a229c8b1d4699c99 100644 (file)
@@ -2457,14 +2457,14 @@ static int cs47l85_open(struct snd_compr_stream *stream)
        struct madera *madera = priv->madera;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l85-dsp-voicectrl") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-voicectrl") == 0) {
                n_adsp = 5;
-       } else if (strcmp(rtd->codec_dai->name, "cs47l85-dsp-trace") == 0) {
+       } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l85-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(madera->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index 266eade8276488e40791986c8d6a4d6aa53dc412..81a1311b14e643ed1c646758026fd99385a2dd9d 100644 (file)
@@ -2368,14 +2368,14 @@ static int cs47l90_open(struct snd_compr_stream *stream)
        struct madera *madera = priv->madera;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l90-dsp-voicectrl") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-voicectrl") == 0) {
                n_adsp = 5;
-       } else if (strcmp(rtd->codec_dai->name, "cs47l90-dsp-trace") == 0) {
+       } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l90-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(madera->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index 942040fd354f61ca67e8fb04b518ab4b60dc7db6..15fc213d178dd19c5f267c6835952c44dfd5c276 100644 (file)
@@ -1840,12 +1840,12 @@ static int cs47l92_open(struct snd_compr_stream *stream)
        struct madera *madera = priv->madera;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "cs47l92-dsp-trace") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "cs47l92-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(madera->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index 9dc215b5c5045b9b9a110819b01716f579279375..499e87d1dfcc7ef7c0d5cd61ef3bb56214f09071 100644 (file)
@@ -2245,14 +2245,14 @@ static int wm5110_open(struct snd_compr_stream *stream)
        struct arizona *arizona = priv->core.arizona;
        int n_adsp;
 
-       if (strcmp(rtd->codec_dai->name, "wm5110-dsp-voicectrl") == 0) {
+       if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-voicectrl") == 0) {
                n_adsp = 2;
-       } else if (strcmp(rtd->codec_dai->name, "wm5110-dsp-trace") == 0) {
+       } else if (strcmp(asoc_rtd_to_codec(rtd, 0)->name, "wm5110-dsp-trace") == 0) {
                n_adsp = 0;
        } else {
                dev_err(arizona->dev,
                        "No suitable compressed stream for DAI '%s'\n",
-                       rtd->codec_dai->name);
+                       asoc_rtd_to_codec(rtd, 0)->name);
                return -EINVAL;
        }
 
index ffb9836e05383af1be1d2ae4d1763e53d42357c9..1ef69409ccd1e0f5885b60f2d0357f2ee927ee9c 100644 (file)
@@ -3467,22 +3467,22 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream)
 
        if (wm_adsp_fw[dsp->fw].num_caps == 0) {
                adsp_err(dsp, "%s: Firmware does not support compressed API\n",
-                        rtd->codec_dai->name);
+                        asoc_rtd_to_codec(rtd, 0)->name);
                ret = -ENXIO;
                goto out;
        }
 
        if (wm_adsp_fw[dsp->fw].compr_direction != stream->direction) {
                adsp_err(dsp, "%s: Firmware does not support stream direction\n",
-                        rtd->codec_dai->name);
+                        asoc_rtd_to_codec(rtd, 0)->name);
                ret = -EINVAL;
                goto out;
        }
 
        list_for_each_entry(tmp, &dsp->compr_list, list) {
-               if (!strcmp(tmp->name, rtd->codec_dai->name)) {
+               if (!strcmp(tmp->name, asoc_rtd_to_codec(rtd, 0)->name)) {
                        adsp_err(dsp, "%s: Only a single stream supported per dai\n",
-                                rtd->codec_dai->name);
+                                asoc_rtd_to_codec(rtd, 0)->name);
                        ret = -EBUSY;
                        goto out;
                }
@@ -3496,7 +3496,7 @@ int wm_adsp_compr_open(struct wm_adsp *dsp, struct snd_compr_stream *stream)
 
        compr->dsp = dsp;
        compr->stream = stream;
-       compr->name = rtd->codec_dai->name;
+       compr->name = asoc_rtd_to_codec(rtd, 0)->name;
 
        list_add_tail(&compr->list, &dsp->compr_list);