ASoC: constify of_phandle_args in snd_soc_get_dai_name()
Subsystems (5)
PATCH 1/1 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.
--- include/sound/soc-component.h | 4 ++-- include/sound/soc.h | 2 +- sound/soc/meson/aiu-acodec-ctrl.c | 2 +- sound/soc/meson/aiu-codec-ctrl.c | 2 +- sound/soc/meson/aiu.c | 4 ++-- sound/soc/meson/aiu.h | 2 +- sound/soc/qcom/lpass-cpu.c | 2 +- sound/soc/qcom/qdsp6/q6afe-dai.c | 2 +- sound/soc/soc-component.c | 2 +- sound/soc/soc-core.c | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-)
include/sound/soc-component.h +2 -2
@@ -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,
include/sound/soc.h +1 -1
@@ -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);
sound/soc/meson/aiu-acodec-ctrl.c +1 -1
@@ -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 );
sound/soc/meson/aiu-codec-ctrl.c +1 -1
@@ -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 );
sound/soc/meson/aiu.c +2 -2
@@ -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 );
sound/soc/meson/aiu.h +1 -1
@@ -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);
sound/soc/qcom/lpass-cpu.c +1 -1
@@ -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);
sound/soc/qcom/qdsp6/q6afe-dai.c +1 -1
@@ -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 ];
sound/soc/soc-component.c +1 -1
@@ -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)
sound/soc/soc-core.c +1 -1
@@ -2994,7 +2994,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;
Signature · 7 lines
2.25.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Mark Brown
maintainerQuoted 4 lines · Krzysztof Kozlowski
The pointer to
of_phandle_argspassed tosnd_soc_get_dai_name()andof_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.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: constify of_phandle_args in snd_soc_get_dai_name()
commit: 54928c5c63c83afd5a1c2a91802a9c37e9a4ff88
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
_______________________________________________
linux-amlogic mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-amlogic