ASoC: rsnd: merge DAI call back functions into ops
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Tue, 8 Aug 2023 22:56:28 +0000 (22:56 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 14 Aug 2023 12:10:13 +0000 (13:10 +0100)
ALSA SoC merges DAI call backs into .ops.
This patch merge these into one.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/87bkfhb0tg.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/sh/rcar/core.c

index cf2031b..e29c2fe 100644 (file)
@@ -1085,17 +1085,6 @@ static u64 rsnd_soc_dai_formats[] = {
        SND_SOC_POSSIBLE_DAIFMT_DSP_B,
 };
 
-static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
-       .startup        = rsnd_soc_dai_startup,
-       .shutdown       = rsnd_soc_dai_shutdown,
-       .trigger        = rsnd_soc_dai_trigger,
-       .set_fmt        = rsnd_soc_dai_set_fmt,
-       .set_tdm_slot   = rsnd_soc_set_dai_tdm_slot,
-       .prepare        = rsnd_soc_dai_prepare,
-       .auto_selectable_formats        = rsnd_soc_dai_formats,
-       .num_auto_selectable_formats    = ARRAY_SIZE(rsnd_soc_dai_formats),
-};
-
 static void rsnd_parse_tdm_split_mode(struct rsnd_priv *priv,
                                      struct rsnd_dai_stream *io,
                                      struct device_node *dai_np)
@@ -1355,8 +1344,7 @@ static int rsnd_preallocate_pages(struct snd_soc_pcm_runtime *rtd,
        return 0;
 }
 
-static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd,
-                       struct snd_soc_dai *dai)
+static int rsnd_soc_dai_pcm_new(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai)
 {
        struct rsnd_dai *rdai = rsnd_dai_to_rdai(dai);
        int ret;
@@ -1382,6 +1370,18 @@ static int rsnd_pcm_new(struct snd_soc_pcm_runtime *rtd,
        return 0;
 }
 
+static const struct snd_soc_dai_ops rsnd_soc_dai_ops = {
+       .pcm_new                        = rsnd_soc_dai_pcm_new,
+       .startup                        = rsnd_soc_dai_startup,
+       .shutdown                       = rsnd_soc_dai_shutdown,
+       .trigger                        = rsnd_soc_dai_trigger,
+       .set_fmt                        = rsnd_soc_dai_set_fmt,
+       .set_tdm_slot                   = rsnd_soc_set_dai_tdm_slot,
+       .prepare                        = rsnd_soc_dai_prepare,
+       .auto_selectable_formats        = rsnd_soc_dai_formats,
+       .num_auto_selectable_formats    = ARRAY_SIZE(rsnd_soc_dai_formats),
+};
+
 static void __rsnd_dai_probe(struct rsnd_priv *priv,
                             struct device_node *dai_np,
                             struct device_node *node_np,
@@ -1411,7 +1411,6 @@ static void __rsnd_dai_probe(struct rsnd_priv *priv,
        rdai->priv      = priv;
        drv->name       = rdai->name;
        drv->ops        = &rsnd_soc_dai_ops;
-       drv->pcm_new    = rsnd_pcm_new;
        drv->id         = dai_i;
        drv->dai_args   = &rdai->dai_args;