Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ASoC: topology: Constify an argument of snd_soc_tplg_component_load()

snd_soc_tplg_component_load() does not modify its "*ops" argument. It
only read some values and stores it in "soc_tplg.ops".

This argument and the ops field in "struct soc_tplg" can be made const.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Link: https://msgid.link/r/f2f983e791d7f941a95556bb147f426a345d84d4.1715526069.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Christophe JAILLET and committed by
Mark Brown
73444768 d556f807

+3 -3
+1 -1
include/sound/soc-topology.h
··· 178 178 179 179 /* Dynamic Object loading and removal for component drivers */ 180 180 int snd_soc_tplg_component_load(struct snd_soc_component *comp, 181 - struct snd_soc_tplg_ops *ops, const struct firmware *fw); 181 + const struct snd_soc_tplg_ops *ops, const struct firmware *fw); 182 182 int snd_soc_tplg_component_remove(struct snd_soc_component *comp); 183 183 184 184 /* Binds event handlers to dynamic widgets */
+2 -2
sound/soc/soc-topology.c
··· 73 73 int bytes_ext_ops_count; 74 74 75 75 /* optional fw loading callbacks to component drivers */ 76 - struct snd_soc_tplg_ops *ops; 76 + const struct snd_soc_tplg_ops *ops; 77 77 }; 78 78 79 79 /* check we dont overflow the data for this control chunk */ ··· 2334 2334 2335 2335 /* load audio component topology from "firmware" file */ 2336 2336 int snd_soc_tplg_component_load(struct snd_soc_component *comp, 2337 - struct snd_soc_tplg_ops *ops, const struct firmware *fw) 2337 + const struct snd_soc_tplg_ops *ops, const struct firmware *fw) 2338 2338 { 2339 2339 struct soc_tplg tplg; 2340 2340 int ret;