ASoC: tegra: Constify static snd_soc_dai_ops structs
authorRikard Falkeborn <rikard.falkeborn@gmail.com>
Wed, 22 Sep 2021 20:54:38 +0000 (22:54 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 27 Sep 2021 12:01:03 +0000 (13:01 +0100)
The only usage of these 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>
Acked-by: Sameer Pujar <spujar@nvidia.com>
Link: https://lore.kernel.org/r/20210922205438.34519-1-rikard.falkeborn@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/tegra/tegra210_adx.c
sound/soc/tegra/tegra210_amx.c
sound/soc/tegra/tegra210_mixer.c
sound/soc/tegra/tegra210_mvc.c
sound/soc/tegra/tegra210_sfc.c

index 78d660447bb190fe6bd3817e45f638a518b08532..d7c7849c2f92c999b8463b7715284e6555fb74b7 100644 (file)
@@ -206,12 +206,12 @@ static int tegra210_adx_put_byte_map(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_adx_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_adx_in_dai_ops = {
        .hw_params      = tegra210_adx_in_hw_params,
        .startup        = tegra210_adx_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_adx_out_dai_ops = {
        .hw_params      = tegra210_adx_out_hw_params,
 };
 
index 83176e1663ab19f7dfe76c5c5549bab1314738ac..af9bddfc312073d70ded76d3deffb2d5bf637fe7 100644 (file)
@@ -241,12 +241,12 @@ static int tegra210_amx_put_byte_map(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_amx_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_amx_out_dai_ops = {
        .hw_params      = tegra210_amx_out_hw_params,
        .startup        = tegra210_amx_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_amx_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_amx_in_dai_ops = {
        .hw_params      = tegra210_amx_in_hw_params,
 };
 
index 53fcd8f6605a6473efe167a4de33474f8e1f1597..55e61776c565ad68cb24f86e59953e4bb804c69c 100644 (file)
@@ -283,11 +283,11 @@ static int tegra210_mixer_out_hw_params(struct snd_pcm_substream *substream,
                                            dai->id - TEGRA210_MIXER_RX_MAX);
 }
 
-static struct snd_soc_dai_ops tegra210_mixer_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mixer_out_dai_ops = {
        .hw_params      = tegra210_mixer_out_hw_params,
 };
 
-static struct snd_soc_dai_ops tegra210_mixer_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mixer_in_dai_ops = {
        .hw_params      = tegra210_mixer_in_hw_params,
 };
 
index 3646ce9b0fd156e11587956c3dcf1e9ebf9de96a..7b9c7006e4197e5fc3537b448de461285b019a2a 100644 (file)
@@ -387,7 +387,7 @@ static int tegra210_mvc_hw_params(struct snd_pcm_substream *substream,
        return 0;
 }
 
-static struct snd_soc_dai_ops tegra210_mvc_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_mvc_dai_ops = {
        .hw_params      = tegra210_mvc_hw_params,
 };
 
index 260dca6f6d25a851405f803910f6b71bd5bb862f..dc477ee1b82cd06041bed5ca4940a21d856f1398 100644 (file)
@@ -3287,12 +3287,12 @@ static int tegra210_sfc_put_control(struct snd_kcontrol *kcontrol,
        return 1;
 }
 
-static struct snd_soc_dai_ops tegra210_sfc_in_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_sfc_in_dai_ops = {
        .hw_params      = tegra210_sfc_in_hw_params,
        .startup        = tegra210_sfc_startup,
 };
 
-static struct snd_soc_dai_ops tegra210_sfc_out_dai_ops = {
+static const struct snd_soc_dai_ops tegra210_sfc_out_dai_ops = {
        .hw_params      = tegra210_sfc_out_hw_params,
 };