ASoC: rt*: Constify static struct snd_soc_dai_ops
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 24 Feb 2021 21:19:16 +0000 (22:19 +0100)
committerMark Brown <broonie@kernel.org>
Wed, 10 Mar 2021 13:06:33 +0000 (13:06 +0000)
The only usage of them is to assign their address to the ops field in
the snd_soc_dai_driver struct, which is a pointer to const. 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/20210224211918.39109-3-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/rt1015.c
sound/soc/codecs/rt1016.c
sound/soc/codecs/rt5682-sdw.c
sound/soc/codecs/rt700.c
sound/soc/codecs/rt711.c
sound/soc/codecs/rt715.c

index 844e4079d176022b8a2f36049454ffcbb6d93c0f..501cc45240b4a5ffb7c8ba03e85ed300fb8950db 100644 (file)
@@ -1028,7 +1028,7 @@ static void rt1015_remove(struct snd_soc_component *component)
 #define RT1015_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-static struct snd_soc_dai_ops rt1015_aif_dai_ops = {
+static const struct snd_soc_dai_ops rt1015_aif_dai_ops = {
        .hw_params = rt1015_hw_params,
        .set_fmt = rt1015_set_dai_fmt,
        .set_tdm_slot = rt1015_set_tdm_slot,
index a23d368ab4da45b274caf2e749e8feba54553e1b..483375fc16cac0d99e756de09d4920842ceb755f 100644 (file)
@@ -534,7 +534,7 @@ static void rt1016_remove(struct snd_soc_component *component)
 #define RT1016_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-static struct snd_soc_dai_ops rt1016_aif_dai_ops = {
+static const struct snd_soc_dai_ops rt1016_aif_dai_ops = {
        .hw_params = rt1016_hw_params,
        .set_fmt = rt1016_set_dai_fmt,
 };
index 0b7ac74e671d248c74376106935e1fd333b45ce1..5e097f776561a4d710ea14cd0d4614953a2643cd 100644 (file)
@@ -269,7 +269,7 @@ static int rt5682_sdw_hw_free(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_dai_ops rt5682_sdw_ops = {
+static const struct snd_soc_dai_ops rt5682_sdw_ops = {
        .hw_params      = rt5682_sdw_hw_params,
        .hw_free        = rt5682_sdw_hw_free,
        .set_sdw_stream = rt5682_set_sdw_stream,
index 66ec395dbbcd9e17a97d73236a495a4db0e816b7..01af9d9dd3ca646918a89f85c95e283a7b02db32 100644 (file)
@@ -1002,7 +1002,7 @@ static int rt700_pcm_hw_free(struct snd_pcm_substream *substream,
 #define RT700_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-static struct snd_soc_dai_ops rt700_ops = {
+static const struct snd_soc_dai_ops rt700_ops = {
        .hw_params      = rt700_pcm_hw_params,
        .hw_free        = rt700_pcm_hw_free,
        .set_sdw_stream = rt700_set_sdw_stream,
index 85f744184a60fe4302baf6e9a58f0190d23ab5a3..202bf6fbc5be7780c0ae4d49300291dfdd3e5084 100644 (file)
@@ -1048,7 +1048,7 @@ static int rt711_pcm_hw_free(struct snd_pcm_substream *substream,
 #define RT711_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-static struct snd_soc_dai_ops rt711_ops = {
+static const struct snd_soc_dai_ops rt711_ops = {
        .hw_params      = rt711_pcm_hw_params,
        .hw_free        = rt711_pcm_hw_free,
        .set_sdw_stream = rt711_set_sdw_stream,
index 9a7d393d424a85ca6da192b3e758ddcb9f74fcdd..f419d001a3fb930a106056f004e2dcbb793595ca 100644 (file)
@@ -683,7 +683,7 @@ static int rt715_pcm_hw_free(struct snd_pcm_substream *substream,
 #define RT715_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8)
 
-static struct snd_soc_dai_ops rt715_ops = {
+static const struct snd_soc_dai_ops rt715_ops = {
        .hw_params      = rt715_pcm_hw_params,
        .hw_free        = rt715_pcm_hw_free,
        .set_sdw_stream = rt715_set_sdw_stream,