]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
ASoC: constify of_phandle_args in snd_soc_get_dai_name()
authorKrzysztof Kozlowski <krzk@kernel.org>
Sun, 21 Feb 2021 15:30:24 +0000 (16:30 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:07:14 +0000 (13:07 +0000)
The pointer to of_phandle_args passed to snd_soc_get_dai_name() and
of_xlate_dai_name() implementations is not modified.  Since it is being
used only to translate passed OF node to a DAI name, it should not be
modified, so mark it as const for correctness and safer code.

Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20210221153024.453583-1-krzk@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/soc-component.h
include/sound/soc.h
sound/soc/meson/aiu-acodec-ctrl.c
sound/soc/meson/aiu-codec-ctrl.c
sound/soc/meson/aiu.c
sound/soc/meson/aiu.h
sound/soc/qcom/lpass-cpu.c
sound/soc/qcom/qdsp6/q6afe-dai.c
sound/soc/soc-component.c
sound/soc/soc-core.c

index 5b47768222b7f975038583553db8c517f341263a..7dc75b39287f5d256c296620af1cafde3fd7a43f 100644 (file)
@@ -101,7 +101,7 @@ struct snd_soc_component_driver {
 
        /* DT */
        int (*of_xlate_dai_name)(struct snd_soc_component *component,
-                                struct of_phandle_args *args,
+                                const struct of_phandle_args *args,
                                 const char **dai_name);
        int (*of_xlate_dai_id)(struct snd_soc_component *comment,
                               struct device_node *endpoint);
@@ -450,7 +450,7 @@ void snd_soc_component_remove(struct snd_soc_component *component);
 int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
                                      struct device_node *ep);
 int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
-                                       struct of_phandle_args *args,
+                                       const struct of_phandle_args *args,
                                        const char **dai_name);
 int snd_soc_component_compr_open(struct snd_compr_stream *cstream);
 void snd_soc_component_compr_free(struct snd_compr_stream *cstream,
index bd38015d6c6d825d3ee04240af6cce136f596c29..78609ab331c8435ef1df00c08565aa0ee5f090a1 100644 (file)
@@ -1219,7 +1219,7 @@ unsigned int snd_soc_of_parse_daifmt(struct device_node *np,
                                     struct device_node **bitclkmaster,
                                     struct device_node **framemaster);
 int snd_soc_get_dai_id(struct device_node *ep);
-int snd_soc_get_dai_name(struct of_phandle_args *args,
+int snd_soc_get_dai_name(const struct of_phandle_args *args,
                         const char **dai_name);
 int snd_soc_of_get_dai_name(struct device_node *of_node,
                            const char **dai_name);
index 7078197e0cc5027633b6c3957eabd5c6c0eea799..27a6d3259c50ad6fa26a913cf7b5b45b8c186d97 100644 (file)
@@ -159,7 +159,7 @@ static const struct snd_kcontrol_new aiu_acodec_ctrl_controls[] = {
 };
 
 static int aiu_acodec_of_xlate_dai_name(struct snd_soc_component *component,
-                                       struct of_phandle_args *args,
+                                       const struct of_phandle_args *args,
                                        const char **dai_name)
 {
        return aiu_of_xlate_dai_name(component, args, dai_name, AIU_ACODEC);
index 4b773d3e8b073558aeef00d9f69d777785af025f..c3ea733fce91fdbe79c05bc4ce53a1aed69a95ea 100644 (file)
@@ -125,7 +125,7 @@ static const struct snd_soc_dapm_route aiu_hdmi_ctrl_routes[] = {
 };
 
 static int aiu_hdmi_of_xlate_dai_name(struct snd_soc_component *component,
-                                     struct of_phandle_args *args,
+                                     const struct of_phandle_args *args,
                                      const char **dai_name)
 {
        return aiu_of_xlate_dai_name(component, args, dai_name, AIU_HDMI);
index dc35ca79021c5760a388e66b60e5e81419580d4f..ba15d5762b0bf30171946f78b6c13d6bf7f05f26 100644 (file)
@@ -42,7 +42,7 @@ static const struct snd_soc_dapm_route aiu_cpu_dapm_routes[] = {
 };
 
 int aiu_of_xlate_dai_name(struct snd_soc_component *component,
-                         struct of_phandle_args *args,
+                         const struct of_phandle_args *args,
                          const char **dai_name,
                          unsigned int component_id)
 {
@@ -72,7 +72,7 @@ int aiu_of_xlate_dai_name(struct snd_soc_component *component,
 }
 
 static int aiu_cpu_of_xlate_dai_name(struct snd_soc_component *component,
-                                    struct of_phandle_args *args,
+                                    const struct of_phandle_args *args,
                                     const char **dai_name)
 {
        return aiu_of_xlate_dai_name(component, args, dai_name, AIU_CPU);
index 87aa19ac4af3aff0267519db2ba86d4245db9455..393b6c2307e49ff212c6e9676b3072a6f82b587b 100644 (file)
@@ -45,7 +45,7 @@ struct aiu {
                     SNDRV_PCM_FMTBIT_S24_LE)
 
 int aiu_of_xlate_dai_name(struct snd_soc_component *component,
-                         struct of_phandle_args *args,
+                         const struct of_phandle_args *args,
                          const char **dai_name,
                          unsigned int component_id);
 
index c642e5f8f28c4c942689059d8ee9a98506621a56..4762286b33fea98a07e93d44baf0f65a637ddaa4 100644 (file)
@@ -340,7 +340,7 @@ int asoc_qcom_lpass_cpu_dai_probe(struct snd_soc_dai *dai)
 EXPORT_SYMBOL_GPL(asoc_qcom_lpass_cpu_dai_probe);
 
 static int asoc_qcom_of_xlate_dai_name(struct snd_soc_component *component,
-                                  struct of_phandle_args *args,
+                                  const struct of_phandle_args *args,
                                   const char **dai_name)
 {
        struct lpass_data *drvdata = snd_soc_component_get_drvdata(component);
index 4e1f101281e7db4779890f7e7ffc3f72699f5aa7..e8915519f427434f2bbecb5af087ae4a9f2a32c0 100644 (file)
@@ -1315,7 +1315,7 @@ static struct snd_soc_dai_driver q6afe_dais[] = {
 };
 
 static int q6afe_of_xlate_dai_name(struct snd_soc_component *component,
-                                  struct of_phandle_args *args,
+                                  const struct of_phandle_args *args,
                                   const char **dai_name)
 {
        int id = args->args[0];
index 159bf88b9f8cdfe2e496b28a4b2cca9c54492fa4..8415e9bd2932185a9ee2c1abe38e031210d97fb9 100644 (file)
@@ -370,7 +370,7 @@ int snd_soc_component_of_xlate_dai_id(struct snd_soc_component *component,
 }
 
 int snd_soc_component_of_xlate_dai_name(struct snd_soc_component *component,
-                                       struct of_phandle_args *args,
+                                       const struct of_phandle_args *args,
                                        const char **dai_name)
 {
        if (component->driver->of_xlate_dai_name)
index 0cffc9527e28902371f677b5a2c468560069e63c..16ba54eb8164b2e2220ba841284f781d718502ee 100644 (file)
@@ -2998,7 +2998,7 @@ int snd_soc_get_dai_id(struct device_node *ep)
 }
 EXPORT_SYMBOL_GPL(snd_soc_get_dai_id);
 
-int snd_soc_get_dai_name(struct of_phandle_args *args,
+int snd_soc_get_dai_name(const struct of_phandle_args *args,
                                const char **dai_name)
 {
        struct snd_soc_component *pos;