ASoC: samsung: Constify static snd_soc_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 28 Jul 2021 17:25:48 +0000 (19:25 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 29 Jul 2021 14:35:48 +0000 (15:35 +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>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Link: https://lore.kernel.org/r/20210728172548.234943-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
13 files changed:
sound/soc/samsung/aries_wm8994.c
sound/soc/samsung/arndale.c
sound/soc/samsung/h1940_uda1380.c
sound/soc/samsung/littlemill.c
sound/soc/samsung/midas_wm1811.c
sound/soc/samsung/neo1973_wm8753.c
sound/soc/samsung/rx1950_uda1380.c
sound/soc/samsung/smartq_wm8987.c
sound/soc/samsung/smdk_wm8580.c
sound/soc/samsung/smdk_wm8994.c
sound/soc/samsung/smdk_wm8994pcm.c
sound/soc/samsung/tm2_wm5110.c
sound/soc/samsung/tobermory.c

index 0ac5956ba270d7360109d3f9dd9086c3301dfc5c..313ab650f8d9f2d3243dc20d00e2412bd2fcf9d5 100644 (file)
@@ -310,7 +310,7 @@ static int aries_hw_free(struct snd_pcm_substream *substream)
 /*
  * Main DAI operations
  */
-static struct snd_soc_ops aries_ops = {
+static const struct snd_soc_ops aries_ops = {
        .hw_params = aries_hw_params,
        .hw_free = aries_hw_free,
 };
index 28587375813ac9a8cd4209b20ec6c74d86f363d8..606ac5e33a8e9f32728467cf02c54077efee501d 100644 (file)
@@ -48,7 +48,7 @@ static int arndale_rt5631_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops arndale_rt5631_ops = {
+static const struct snd_soc_ops arndale_rt5631_ops = {
        .hw_params = arndale_rt5631_hw_params,
 };
 
@@ -80,7 +80,7 @@ static int arndale_wm1811_hw_params(struct snd_pcm_substream *substream,
                                        rclk + 1, SND_SOC_CLOCK_IN);
 }
 
-static struct snd_soc_ops arndale_wm1811_ops = {
+static const struct snd_soc_ops arndale_wm1811_ops = {
        .hw_params = arndale_wm1811_hw_params,
 };
 
index 8aa78ff640f51573af28555e4916d7893424ee0e..c994e67d1eaf0de0470ff7740cec9adb8d0b7da7 100644 (file)
@@ -112,7 +112,7 @@ static int h1940_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops h1940_ops = {
+static const struct snd_soc_ops h1940_ops = {
        .startup        = h1940_startup,
        .hw_params      = h1940_hw_params,
 };
index a1ff1400857ed715fcd973781bb83f5085f396dc..390f2dd735ad26eecb7274a49e8380d28cee58bc 100644 (file)
@@ -130,7 +130,7 @@ static int littlemill_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops littlemill_ops = {
+static const struct snd_soc_ops littlemill_ops = {
        .hw_params = littlemill_hw_params,
 };
 
index 1f9a553edf198a4d62c752410004d62c0c426092..a2019535a0b10332ad5dc0ba420b94fd8e646c5c 100644 (file)
@@ -129,7 +129,7 @@ static int midas_aif1_hw_params(struct snd_pcm_substream *substream,
        return midas_start_fll1(rtd, pll_out);
 }
 
-static struct snd_soc_ops midas_aif1_ops = {
+static const struct snd_soc_ops midas_aif1_ops = {
        .hw_params = midas_aif1_hw_params,
 };
 
index 9266070e01811521b25277fb123943b508def47a..c98b68567a89d379b2bbe44e6324e875065c2c5c 100644 (file)
@@ -106,7 +106,7 @@ static int neo1973_hifi_hw_free(struct snd_pcm_substream *substream)
 /*
  * Neo1973 WM8753 HiFi DAI opserations.
  */
-static struct snd_soc_ops neo1973_hifi_ops = {
+static const struct snd_soc_ops neo1973_hifi_ops = {
        .hw_params = neo1973_hifi_hw_params,
        .hw_free = neo1973_hifi_hw_free,
 };
@@ -158,7 +158,7 @@ static int neo1973_voice_hw_free(struct snd_pcm_substream *substream)
        return snd_soc_dai_set_pll(codec_dai, WM8753_PLL2, 0, 0, 0);
 }
 
-static struct snd_soc_ops neo1973_voice_ops = {
+static const struct snd_soc_ops neo1973_voice_ops = {
        .hw_params = neo1973_voice_hw_params,
        .hw_free = neo1973_voice_hw_free,
 };
index 400a7f77c7117831b8b89089ff80f047b2c5778e..6ea1c8cc91675532864bfe0bab0125dc9e204a02 100644 (file)
@@ -62,7 +62,7 @@ static struct snd_soc_jack_gpio hp_jack_gpios[] = {
        },
 };
 
-static struct snd_soc_ops rx1950_ops = {
+static const struct snd_soc_ops rx1950_ops = {
        .startup        = rx1950_startup,
        .hw_params      = rx1950_hw_params,
 };
index c95629becbc342f9edd77fa48a95958ef21cd642..cee39ad16667a432d0e716e6eaee98b98bc32775 100644 (file)
@@ -70,7 +70,7 @@ static int smartq_hifi_hw_params(struct snd_pcm_substream *substream,
 /*
  * SmartQ WM8987 HiFi DAI operations.
  */
-static struct snd_soc_ops smartq_hifi_ops = {
+static const struct snd_soc_ops smartq_hifi_ops = {
        .hw_params = smartq_hifi_hw_params,
 };
 
index ed753a2f202e0ccc192f6eb0cb8d2a429139535b..78703d095a6fa2215992201589409619aef9e671 100644 (file)
@@ -86,7 +86,7 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
 /*
  * SMDK WM8580 DAI operations.
  */
-static struct snd_soc_ops smdk_ops = {
+static const struct snd_soc_ops smdk_ops = {
        .hw_params = smdk_hw_params,
 };
 
index 39a7a449f5542654079418320ebce00c4eb153b0..7661b637946d1e22952a5152bd8865e0d05bc365 100644 (file)
@@ -73,7 +73,7 @@ static int smdk_hw_params(struct snd_pcm_substream *substream,
 /*
  * SMDK WM8994 DAI operations.
  */
-static struct snd_soc_ops smdk_ops = {
+static const struct snd_soc_ops smdk_ops = {
        .hw_params = smdk_hw_params,
 };
 
index a01640576f71d677618af9131b857f5fca741e1d..029448f5bedbe8bd53b871d0e1cb284e0d83ac35 100644 (file)
@@ -85,7 +85,7 @@ static int smdk_wm8994_pcm_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops smdk_wm8994_pcm_ops = {
+static const struct snd_soc_ops smdk_wm8994_pcm_ops = {
        .hw_params = smdk_wm8994_pcm_hw_params,
 };
 
index 84c2c63d5a877dac500a90fda19b46ae60f68349..a2c77e6defec5fdbad132ff5a9c81d1450aa0fa1 100644 (file)
@@ -126,7 +126,7 @@ static int tm2_aif1_hw_params(struct snd_pcm_substream *substream,
        return tm2_start_sysclk(rtd->card);
 }
 
-static struct snd_soc_ops tm2_aif1_ops = {
+static const struct snd_soc_ops tm2_aif1_ops = {
        .hw_params = tm2_aif1_hw_params,
 };
 
@@ -200,7 +200,7 @@ static int tm2_aif2_hw_free(struct snd_pcm_substream *substream)
        return ret;
 }
 
-static struct snd_soc_ops tm2_aif2_ops = {
+static const struct snd_soc_ops tm2_aif2_ops = {
        .hw_params = tm2_aif2_hw_params,
        .hw_free = tm2_aif2_hw_free,
 };
@@ -254,7 +254,7 @@ static int tm2_hdmi_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops tm2_hdmi_ops = {
+static const struct snd_soc_ops tm2_hdmi_ops = {
        .hw_params = tm2_hdmi_hw_params,
 };
 
index c962d2c2a7f78941b7fa84519091032cfb4f46cc..15223d860cb725e0fe8fb4da7424dbbf0faa194b 100644 (file)
@@ -105,7 +105,7 @@ static int tobermory_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_ops tobermory_ops = {
+static const struct snd_soc_ops tobermory_ops = {
        .hw_params = tobermory_hw_params,
 };