summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/ops.h
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>2021-12-16 17:24:20 -0600
committerMark Brown <broonie@kernel.org>2021-12-17 11:06:16 +0000
commitcb515f105cab124c5740e70dd0e8c78186ae81b7 (patch)
tree6d56cbb961986e6e50a2dd083cc42728bd39b0af /sound/soc/sof/ops.h
parent0f2ee77d2655bd4bb205fff16822e551159f41c9 (diff)
downloadlinux-cb515f105cab124c5740e70dd0e8c78186ae81b7.tar.bz2
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.h8
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)