ASoC: fsl: Constify static snd_soc_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Mon, 20 Sep 2021 19:39:47 +0000 (21:39 +0200)
committerMark Brown <broonie@kernel.org>
Tue, 21 Sep 2021 12:24:51 +0000 (13:24 +0100)
These are only assigned to the ops field in the snd_soc_dai_link struct
which is a pointer to const struct snd_soc_ops. Make them const to allow
the compiler to put them in read-only memory.

Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Link: https://lore.kernel.org/r/20210920193947.10237-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/imx-audmix.c
sound/soc/fsl/imx-card.c
sound/soc/fsl/imx-hdmi.c

index a364e24..0d63792 100644 (file)
@@ -132,12 +132,12 @@ static int imx_audmix_be_hw_params(struct snd_pcm_substream *substream,
        return ret;
 }
 
-static struct snd_soc_ops imx_audmix_fe_ops = {
+static const struct snd_soc_ops imx_audmix_fe_ops = {
        .startup = imx_audmix_fe_startup,
        .hw_params = imx_audmix_fe_hw_params,
 };
 
-static struct snd_soc_ops imx_audmix_be_ops = {
+static const struct snd_soc_ops imx_audmix_be_ops = {
        .hw_params = imx_audmix_be_hw_params,
 };
 
index 58fd063..05dff2d 100644 (file)
@@ -442,12 +442,12 @@ static int imx_aif_startup(struct snd_pcm_substream *substream)
        return ret;
 }
 
-static struct snd_soc_ops imx_aif_ops = {
+static const struct snd_soc_ops imx_aif_ops = {
        .hw_params = imx_aif_hw_params,
        .startup = imx_aif_startup,
 };
 
-static struct snd_soc_ops imx_aif_ops_be = {
+static const struct snd_soc_ops imx_aif_ops_be = {
        .hw_params = imx_aif_hw_params,
 };
 
index 34a0dce..2b663c3 100644 (file)
@@ -59,7 +59,7 @@ static int imx_hdmi_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops imx_hdmi_ops = {
+static const struct snd_soc_ops imx_hdmi_ops = {
        .hw_params = imx_hdmi_hw_params,
 };