]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
ASoC: soc-core: reduce if/else nest on soc_probe_link_dais
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Mon, 21 Jan 2019 00:32:50 +0000 (09:32 +0900)
committerMark Brown <broonie@kernel.org>
Mon, 21 Jan 2019 18:13:33 +0000 (18:13 +0000)
Deep nested codec is not readable.
Let's reduce if/else nest.

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

index d59b5ea9fa2540c64272f0024b954b4b8ad57e7c..7fc10a41e0e9d434344411a8d147f41775ac66f3 100644 (file)
@@ -1612,27 +1612,24 @@ static int soc_probe_link_dais(struct snd_soc_card *card,
                                         dai_link->stream_name);
                        return ret;
                }
-       } else {
-
-               if (!dai_link->params) {
-                       /* create the pcm */
-                       ret = soc_new_pcm(rtd, num);
-                       if (ret < 0) {
-                               dev_err(card->dev, "ASoC: can't create pcm %s :%d\n",
-                                       dai_link->stream_name, ret);
-                               return ret;
-                       }
-                       ret = soc_link_dai_pcm_new(&cpu_dai, 1, rtd);
-                       if (ret < 0)
-                               return ret;
-                       ret = soc_link_dai_pcm_new(rtd->codec_dais,
-                                                  rtd->num_codecs, rtd);
-                       if (ret < 0)
-                               return ret;
-               } else {
-                       INIT_DELAYED_WORK(&rtd->delayed_work,
-                                               codec2codec_close_delayed_work);
+       } else if (!dai_link->params) {
+               /* create the pcm */
+               ret = soc_new_pcm(rtd, num);
+               if (ret < 0) {
+                       dev_err(card->dev, "ASoC: can't create pcm %s :%d\n",
+                               dai_link->stream_name, ret);
+                       return ret;
                }
+               ret = soc_link_dai_pcm_new(&cpu_dai, 1, rtd);
+               if (ret < 0)
+                       return ret;
+               ret = soc_link_dai_pcm_new(rtd->codec_dais,
+                                          rtd->num_codecs, rtd);
+               if (ret < 0)
+                       return ret;
+       } else {
+               INIT_DELAYED_WORK(&rtd->delayed_work,
+                                 codec2codec_close_delayed_work);
        }
 
        return 0;