ASoC: SOF: Constify stored pointer to snd_sof_dsp_ops
authorKrzysztof Kozlowski <krzk@kernel.org>
Fri, 26 Apr 2024 09:03:51 +0000 (11:03 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 29 Apr 2024 15:16:49 +0000 (00:16 +0900)
The core code does not modify the 'struct snd_sof_dsp_ops', stored in
'struct sof_dev_desc'.  Make the pointer to 'struct snd_sof_dsp_ops'
const to annotate this, make code a bit safer and allow individual
drivers to also define this structure as const.

Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20240426-n-const-ops-var-v2-4-e553fe67ae82@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
include/sound/sof.h

index 05213bb515a38824d6a20b64b1c206272faa1347..780c1a755917b8cff0bc6bc9ef5ad66c26472a56 100644 (file)
@@ -166,7 +166,7 @@ struct sof_dev_desc {
        /* default firmware name */
        const char *default_fw_filename[SOF_IPC_TYPE_COUNT];
 
-       struct snd_sof_dsp_ops *ops;
+       const struct snd_sof_dsp_ops *ops;
        int (*ops_init)(struct snd_sof_dev *sdev);
        void (*ops_free)(struct snd_sof_dev *sdev);
 };