]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ASoC: topology: Constify an argument of snd_soc_tplg_component_load()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 13 May 2024 17:37:20 +0000 (19:37 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 27 May 2024 00:31:15 +0000 (01:31 +0100)
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>
include/sound/soc-topology.h
sound/soc/soc-topology.c

index f055c6917f6c9b3f48e0f8cb1b5299ee2bc40e8e..1eedd203ac29904c6cd76decda273e2515a75577 100644 (file)
@@ -178,7 +178,7 @@ static inline const void *snd_soc_tplg_get_data(struct snd_soc_tplg_hdr *hdr)
 
 /* Dynamic Object loading and removal for component drivers */
 int snd_soc_tplg_component_load(struct snd_soc_component *comp,
-       struct snd_soc_tplg_ops *ops, const struct firmware *fw);
+       const struct snd_soc_tplg_ops *ops, const struct firmware *fw);
 int snd_soc_tplg_component_remove(struct snd_soc_component *comp);
 
 /* Binds event handlers to dynamic widgets */
index 90ca37e008b32c89f545d88397479b0c6a7f65bb..b00ec01361c20b377898a74e2b24bbf7bab550c4 100644 (file)
@@ -73,7 +73,7 @@ struct soc_tplg {
        int bytes_ext_ops_count;
 
        /* optional fw loading callbacks to component drivers */
-       struct snd_soc_tplg_ops *ops;
+       const struct snd_soc_tplg_ops *ops;
 };
 
 /* check we dont overflow the data for this control chunk */
@@ -2334,7 +2334,7 @@ static int soc_tplg_load(struct soc_tplg *tplg)
 
 /* load audio component topology from "firmware" file */
 int snd_soc_tplg_component_load(struct snd_soc_component *comp,
-       struct snd_soc_tplg_ops *ops, const struct firmware *fw)
+       const struct snd_soc_tplg_ops *ops, const struct firmware *fw)
 {
        struct soc_tplg tplg;
        int ret;