diff --git a/include/sound/soc-acpi.h b/include/sound/soc-acpi.h index 266e64e3c24c4f..737a7eebedfabe 100644 --- a/include/sound/soc-acpi.h +++ b/include/sound/soc-acpi.h @@ -81,7 +81,7 @@ struct snd_soc_acpi_mach { const char *board; struct snd_soc_acpi_mach * (*machine_quirk)(void *arg); const void *quirk_data; - void *pdata; + const void *pdata; struct snd_soc_acpi_mach_params mach_params; const char *sof_fw_filename; const char *sof_tplg_filename; diff --git a/include/sound/sof.h b/include/sound/sof.h index 4ed6e23791412e..7cafe846a99f48 100644 --- a/include/sound/sof.h +++ b/include/sound/sof.h @@ -83,9 +83,9 @@ int sof_nocodec_setup(struct device *dev, struct snd_sof_pdata *sof_pdata, struct snd_soc_acpi_mach *mach, const struct sof_dev_desc *desc, - struct snd_sof_dsp_ops *ops); + const struct snd_sof_dsp_ops *ops); -int sof_bes_setup(struct device *dev, struct snd_sof_dsp_ops *ops, +int sof_bes_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, struct snd_soc_dai_link *links, int link_num, struct snd_soc_card *card); #endif diff --git a/sound/soc/sof/hw-spi.c b/sound/soc/sof/hw-spi.c index 2d5f34e66f7487..a9a53c957163c0 100644 --- a/sound/soc/sof/hw-spi.c +++ b/sound/soc/sof/hw-spi.c @@ -275,7 +275,7 @@ static int spi_cmd_done(struct snd_sof_dev *sof_dev __maybe_unused, int dir __ma } /* SPI SOF ops */ -struct snd_sof_dsp_ops snd_sof_spi_ops = { +const struct snd_sof_dsp_ops snd_sof_spi_ops = { /* device init */ .probe = spi_sof_probe, .remove = spi_sof_remove, diff --git a/sound/soc/sof/hw-spi.h b/sound/soc/sof/hw-spi.h index 1929856eabec90..69ba896a1076fd 100644 --- a/sound/soc/sof/hw-spi.h +++ b/sound/soc/sof/hw-spi.h @@ -1,6 +1,6 @@ #ifndef HW_SPI_H #define HW_SPI_H -extern struct snd_sof_dsp_ops snd_sof_spi_ops; +extern const struct snd_sof_dsp_ops snd_sof_spi_ops; #endif diff --git a/sound/soc/sof/intel/apl.c b/sound/soc/sof/intel/apl.c index 61832da260d8bf..5de30087ded6d7 100644 --- a/sound/soc/sof/intel/apl.c +++ b/sound/soc/sof/intel/apl.c @@ -25,7 +25,7 @@ static const struct snd_sof_debugfs_map apl_dsp_debugfs[] = { }; /* apollolake ops */ -struct snd_sof_dsp_ops sof_apl_ops = { +const struct snd_sof_dsp_ops sof_apl_ops = { /* probe and remove */ .probe = hda_dsp_probe, .remove = hda_dsp_remove, diff --git a/sound/soc/sof/intel/bdw.c b/sound/soc/sof/intel/bdw.c index a81f278e8c38b4..b1876cc025804b 100644 --- a/sound/soc/sof/intel/bdw.c +++ b/sound/soc/sof/intel/bdw.c @@ -651,7 +651,7 @@ static struct snd_soc_dai_driver bdw_dai[] = { }; /* broadwell ops */ -struct snd_sof_dsp_ops sof_bdw_ops = { +const struct snd_sof_dsp_ops sof_bdw_ops = { /*Device init */ .probe = bdw_probe, diff --git a/sound/soc/sof/intel/byt.c b/sound/soc/sof/intel/byt.c index 1695d67c336084..1442c47840024d 100644 --- a/sound/soc/sof/intel/byt.c +++ b/sound/soc/sof/intel/byt.c @@ -700,7 +700,7 @@ static struct snd_soc_dai_driver byt_dai[] = { }; /* baytrail ops */ -struct snd_sof_dsp_ops sof_byt_ops = { +const struct snd_sof_dsp_ops sof_byt_ops = { /* device init */ .probe = byt_probe, @@ -751,7 +751,7 @@ struct snd_sof_dsp_ops sof_byt_ops = { EXPORT_SYMBOL(sof_byt_ops); /* cherrytrail and braswell ops */ -struct snd_sof_dsp_ops sof_cht_ops = { +const struct snd_sof_dsp_ops sof_cht_ops = { /* device init */ .probe = byt_probe, diff --git a/sound/soc/sof/intel/cnl.c b/sound/soc/sof/intel/cnl.c index 8e10441d6c8403..dfa441d219837c 100644 --- a/sound/soc/sof/intel/cnl.c +++ b/sound/soc/sof/intel/cnl.c @@ -175,7 +175,7 @@ static int cnl_ipc_send_msg(struct snd_sof_dev *sdev, } /* cannonlake ops */ -struct snd_sof_dsp_ops sof_cnl_ops = { +const struct snd_sof_dsp_ops sof_cnl_ops = { /* probe and remove */ .probe = hda_dsp_probe, .remove = hda_dsp_remove, diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 4a1bbc948b9fdd..c11999e1cae3fa 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -353,7 +353,7 @@ struct sof_intel_dsp_desc { int ipc_ack; int ipc_ack_mask; int ipc_ctl; - struct snd_sof_dsp_ops *ops; + const struct snd_sof_dsp_ops *ops; }; #define SOF_HDA_PLAYBACK_STREAMS 16 @@ -530,8 +530,8 @@ extern struct snd_soc_dai_driver skl_dai[]; /* * Platform Specific HW abstraction Ops. */ -extern struct snd_sof_dsp_ops sof_apl_ops; -extern struct snd_sof_dsp_ops sof_cnl_ops; -extern struct snd_sof_dsp_ops sof_skl_ops; +extern const struct snd_sof_dsp_ops sof_apl_ops; +extern const struct snd_sof_dsp_ops sof_cnl_ops; +extern const struct snd_sof_dsp_ops sof_skl_ops; #endif diff --git a/sound/soc/sof/intel/hsw.c b/sound/soc/sof/intel/hsw.c index 27e5675f7c9623..b64f84a92bf5a4 100644 --- a/sound/soc/sof/intel/hsw.c +++ b/sound/soc/sof/intel/hsw.c @@ -651,7 +651,7 @@ static struct snd_soc_dai_driver hsw_dai[] = { }; /* haswell ops */ -struct snd_sof_dsp_ops sof_hsw_ops = { +const struct snd_sof_dsp_ops sof_hsw_ops = { /*Device init */ .probe = hsw_probe, diff --git a/sound/soc/sof/intel/shim.h b/sound/soc/sof/intel/shim.h index 2fdcb2d262f468..06fc3df26c50ad 100644 --- a/sound/soc/sof/intel/shim.h +++ b/sound/soc/sof/intel/shim.h @@ -151,9 +151,9 @@ #define PCI_PMCS 0x84 #define PCI_PMCS_PS_MASK 0x3 -extern struct snd_sof_dsp_ops sof_byt_ops; -extern struct snd_sof_dsp_ops sof_cht_ops; -extern struct snd_sof_dsp_ops sof_hsw_ops; -extern struct snd_sof_dsp_ops sof_bdw_ops; +extern const struct snd_sof_dsp_ops sof_byt_ops; +extern const struct snd_sof_dsp_ops sof_cht_ops; +extern const struct snd_sof_dsp_ops sof_hsw_ops; +extern const struct snd_sof_dsp_ops sof_bdw_ops; #endif diff --git a/sound/soc/sof/intel/skl.c b/sound/soc/sof/intel/skl.c index f876bee744d320..275000d7884070 100644 --- a/sound/soc/sof/intel/skl.c +++ b/sound/soc/sof/intel/skl.c @@ -25,7 +25,7 @@ static const struct snd_sof_debugfs_map skl_dsp_debugfs[] = { }; /* skylake ops */ -struct snd_sof_dsp_ops sof_skl_ops = { +const struct snd_sof_dsp_ops sof_skl_ops = { /* probe and remove */ .probe = hda_dsp_probe, .remove = hda_dsp_remove, diff --git a/sound/soc/sof/nocodec.c b/sound/soc/sof/nocodec.c index 686324b30a5708..e8b28b12051a00 100644 --- a/sound/soc/sof/nocodec.c +++ b/sound/soc/sof/nocodec.c @@ -20,7 +20,7 @@ int sof_nocodec_setup(struct device *dev, struct snd_sof_pdata *sof_pdata, struct snd_soc_acpi_mach *mach, const struct sof_dev_desc *desc, - struct snd_sof_dsp_ops *ops) + const struct snd_sof_dsp_ops *ops) { struct snd_soc_dai_link *links; int ret; diff --git a/sound/soc/sof/ops.h b/sound/soc/sof/ops.h index 405e39155645a9..15ffda459fb48b 100644 --- a/sound/soc/sof/ops.h +++ b/sound/soc/sof/ops.h @@ -331,7 +331,7 @@ snd_sof_pcm_platform_pointer(struct snd_sof_dev *sdev, return 0; } -static inline struct snd_sof_dsp_ops +static inline const struct snd_sof_dsp_ops *sof_get_ops(const struct sof_dev_desc *d, const struct sof_ops_table mach_ops[], int asize) { diff --git a/sound/soc/sof/sof-acpi-dev.c b/sound/soc/sof/sof-acpi-dev.c index 52de8ac8ede0e8..04fe8e99311c18 100644 --- a/sound/soc/sof/sof-acpi-dev.c +++ b/sound/soc/sof/sof-acpi-dev.c @@ -141,7 +141,7 @@ static int sof_acpi_probe(struct platform_device *pdev) struct snd_soc_acpi_mach *mach; struct snd_sof_pdata *sof_pdata; struct sof_platform_priv *priv; - struct snd_sof_dsp_ops *ops; + const struct snd_sof_dsp_ops *ops; int ret = 0; dev_dbg(&pdev->dev, "ACPI DSP detected"); diff --git a/sound/soc/sof/sof-pci-dev.c b/sound/soc/sof/sof-pci-dev.c index 449ff9cbc793aa..cb4a8fea75fc51 100644 --- a/sound/soc/sof/sof-pci-dev.c +++ b/sound/soc/sof/sof-pci-dev.c @@ -164,7 +164,7 @@ static int sof_pci_probe(struct pci_dev *pci, struct snd_soc_acpi_mach *mach; struct snd_sof_pdata *sof_pdata; struct sof_platform_priv *priv; - struct snd_sof_dsp_ops *ops; + const struct snd_sof_dsp_ops *ops; int ret = 0; dev_dbg(&pci->dev, "PCI DSP detected"); diff --git a/sound/soc/sof/sof-priv.h b/sound/soc/sof/sof-priv.h index f3c609320a3bb2..deb142b4533e73 100644 --- a/sound/soc/sof/sof-priv.h +++ b/sound/soc/sof/sof-priv.h @@ -177,7 +177,7 @@ struct sof_arch_ops { /* DSP device HW descriptor mapping between bus ID and ops */ struct sof_ops_table { const struct sof_dev_desc *desc; - struct snd_sof_dsp_ops *ops; + const struct snd_sof_dsp_ops *ops; }; /* FS entry for debug files that can expose DSP memories, registers */ diff --git a/sound/soc/sof/utils.c b/sound/soc/sof/utils.c index bf66e14bc258b1..753868aefef13d 100644 --- a/sound/soc/sof/utils.c +++ b/sound/soc/sof/utils.c @@ -14,7 +14,7 @@ #include #include "sof-priv.h" -int sof_bes_setup(struct device *dev, struct snd_sof_dsp_ops *ops, +int sof_bes_setup(struct device *dev, const struct snd_sof_dsp_ops *ops, struct snd_soc_dai_link *links, int link_num, struct snd_soc_card *card) { diff --git a/sound/soc/sof/virtio-fe.c b/sound/soc/sof/virtio-fe.c index 6e9de114c2384c..3af6f37bd897ae 100644 --- a/sound/soc/sof/virtio-fe.c +++ b/sound/soc/sof/virtio-fe.c @@ -100,7 +100,7 @@ static int virtio_fe_remove(struct snd_sof_dev *sdev) } /* baytrail ops */ -struct snd_sof_dsp_ops snd_sof_virtio_fe_ops = { +const struct snd_sof_dsp_ops snd_sof_virtio_fe_ops = { /* device init */ .probe = virtio_fe_probe, .remove = virtio_fe_remove,