diff options
author | Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> | 2021-12-17 00:24:20 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-17 12:06:16 +0100 |
commit | cb515f105cab124c5740e70dd0e8c78186ae81b7 (patch) | |
tree | 6d56cbb961986e6e50a2dd083cc42728bd39b0af /sound/soc/sof/ops.h | |
parent | ASoC: Changes to SOF kcontrol data set/get ops (diff) | |
download | linux-cb515f105cab124c5740e70dd0e8c78186ae81b7.tar.xz linux-cb515f105cab124c5740e70dd0e8c78186ae81b7.zip |
ASoC: SOF: avoid casting "const" attribute away
Casting "const" attribute away is dangerous, obtain a writable
pointer instead to avoid that.
Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211216232422.345164-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/sof/ops.h')
-rw-r--r-- | sound/soc/sof/ops.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h index 0226a53148c9..b0ffb2a93bcc 100644 --- a/sound/soc/sof/ops.h +++ b/sound/soc/sof/ops.h @@ -557,15 +557,17 @@ snd_sof_machine_unregister(struct snd_sof_dev *sdev, void *pdata) sof_ops(sdev)->machine_unregister(sdev, pdata); } -static inline void +static inline struct snd_soc_acpi_mach * snd_sof_machine_select(struct snd_sof_dev *sdev) { if (sof_ops(sdev) && sof_ops(sdev)->machine_select) - sof_ops(sdev)->machine_select(sdev); + return sof_ops(sdev)->machine_select(sdev); + + return NULL; } static inline void -snd_sof_set_mach_params(const struct snd_soc_acpi_mach *mach, +snd_sof_set_mach_params(struct snd_soc_acpi_mach *mach, struct snd_sof_dev *sdev) { if (sof_ops(sdev) && sof_ops(sdev)->set_mach_params) |