Unverified Commit 933f98be authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Mark Brown
Browse files

ASoC: constify of_phandle_args in snd_soc_get_dai_name()



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: default avatarKrzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20210221153024.453583-1-krzk@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent e92a309b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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);
Loading