summaryrefslogtreecommitdiffstats
path: root/sound/soc/sof/intel/bdw.c
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/intel/bdw.c
parent0f2ee77d2655bd4bb205fff16822e551159f41c9 (diff)
downloadlinux-cb515f105cab124c5740e70dd0e8c78186ae81b7.tar.gz
linux-cb515f105cab124c5740e70dd0e8c78186ae81b7.tar.bz2
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/intel/bdw.c')
-rw-r--r--sound/soc/sof/intel/bdw.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c
index 1a8a39a878fd..1121711e9029 100644
--- a/sound/soc/sof/intel/bdw.c
+++ b/sound/soc/sof/intel/bdw.c
@@ -509,7 +509,7 @@ static int bdw_probe(struct snd_sof_dev *sdev)
return ret;
}
-static void bdw_machine_select(struct snd_sof_dev *sdev)
+static struct snd_soc_acpi_mach *bdw_machine_select(struct snd_sof_dev *sdev)
{
struct snd_sof_pdata *sof_pdata = sdev->pdata;
const struct sof_dev_desc *desc = sof_pdata->desc;
@@ -518,22 +518,23 @@ static void bdw_machine_select(struct snd_sof_dev *sdev)
mach = snd_soc_acpi_find_machine(desc->machines);
if (!mach) {
dev_warn(sdev->dev, "warning: No matching ASoC machine driver found\n");
- return;
+ return NULL;
}
sof_pdata->tplg_filename = mach->sof_tplg_filename;
mach->mach_params.acpi_ipc_irq_index = desc->irqindex_host_ipc;
- sof_pdata->machine = mach;
+
+ return mach;
}
-static void bdw_set_mach_params(const struct snd_soc_acpi_mach *mach,
+static void bdw_set_mach_params(struct snd_soc_acpi_mach *mach,
struct snd_sof_dev *sdev)
{
struct snd_sof_pdata *pdata = sdev->pdata;
const struct sof_dev_desc *desc = pdata->desc;
struct snd_soc_acpi_mach_params *mach_params;
- mach_params = (struct snd_soc_acpi_mach_params *)&mach->mach_params;
+ mach_params = &mach->mach_params;
mach_params->platform = dev_name(sdev->dev);
mach_params->num_dai_drivers = desc->ops->num_drv;
mach_params->dai_drivers = desc->ops->drv;