]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ASoC: codecs: constify snd_soc_dai_ops structures
authorArvind Yadav <arvind.yadav.cs@gmail.com>
Fri, 18 Aug 2017 12:05:59 +0000 (17:35 +0530)
committerMark Brown <broonie@kernel.org>
Fri, 18 Aug 2017 12:17:48 +0000 (13:17 +0100)
snd_soc_dai_ops are not supposed to change at runtime. All functions
working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with
const snd_soc_dai_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/cs42l42.c
sound/soc/codecs/es8316.c
sound/soc/codecs/inno_rk3036.c
sound/soc/codecs/max9867.c
sound/soc/codecs/max98926.c
sound/soc/codecs/msm8916-wcd-analog.c
sound/soc/codecs/rt5616.c
sound/soc/codecs/rt5663.c
sound/soc/codecs/tas5720.c
sound/soc/codecs/zx_aud96p22.c

index 55e4520cdcaf923f6c2b8d0f00027157aafb57a5..9e860dfa0163f2e8f31134f875a8414c5c6add45 100644 (file)
@@ -911,7 +911,7 @@ static int cs42l42_digital_mute(struct snd_soc_dai *dai, int mute)
                        SNDRV_PCM_FMTBIT_S32_LE)
 
 
-static struct snd_soc_dai_ops cs42l42_ops = {
+static const struct snd_soc_dai_ops cs42l42_ops = {
        .hw_params      = cs42l42_pcm_hw_params,
        .set_fmt        = cs42l42_set_dai_fmt,
        .set_sysclk     = cs42l42_set_sysclk,
index 4f35af6a5d3acaf6eebc38421d43dd9e1c1ccaea..da2d353af5ba29a8c2018673bbddc626a56641cf 100644 (file)
@@ -502,7 +502,7 @@ static int es8316_mute(struct snd_soc_dai *dai, int mute)
 #define ES8316_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
                        SNDRV_PCM_FMTBIT_S24_LE)
 
-static struct snd_soc_dai_ops es8316_ops = {
+static const struct snd_soc_dai_ops es8316_ops = {
        .startup = es8316_pcm_startup,
        .hw_params = es8316_pcm_hw_params,
        .set_fmt = es8316_set_dai_fmt,
index 64b0be94bea32803e98f58dbe9fcfd4268031399..6b59b6f082983d006cb6c49acb6b03339429945e 100644 (file)
@@ -310,7 +310,7 @@ static int rk3036_codec_dai_hw_params(struct snd_pcm_substream *substream,
                           SNDRV_PCM_FMTBIT_S24_LE  | \
                           SNDRV_PCM_FMTBIT_S32_LE)
 
-static struct snd_soc_dai_ops rk3036_codec_dai_ops = {
+static const struct snd_soc_dai_ops rk3036_codec_dai_ops = {
        .set_fmt        = rk3036_codec_dai_set_fmt,
        .hw_params      = rk3036_codec_dai_hw_params,
 };
index 6c0c0d6e8f3cc835cf7728b572ebdd7b4854d728..2f60924fe9196861391ed7a8234c8aab41449b10 100644 (file)
@@ -350,7 +350,7 @@ static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai,
        return 0;
 }
 
-static struct snd_soc_dai_ops max9867_dai_ops = {
+static const struct snd_soc_dai_ops max9867_dai_ops = {
        .set_fmt = max9867_dai_set_fmt,
        .set_sysclk     = max9867_set_dai_sysclk,
        .prepare        = max9867_prepare,
index 7a39bfb9e0f91be14f0eab1050f953626d0877f1..59d03d036945bcbdac936e936e7f87e633693fed 100644 (file)
@@ -459,7 +459,7 @@ static int max98926_dai_hw_params(struct snd_pcm_substream *substream,
 #define MAX98926_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
                SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
 
-static struct snd_soc_dai_ops max98926_dai_ops = {
+static const struct snd_soc_dai_ops max98926_dai_ops = {
        .set_fmt = max98926_dai_set_fmt,
        .hw_params = max98926_dai_hw_params,
 };
index 4cc52cecf3b705815c7ac36bf13ad1d522a809d9..f07674eddc52a6535a7fec13f9e6c927a725752b 100644 (file)
@@ -753,7 +753,7 @@ static void pm8916_wcd_analog_shutdown(struct snd_pcm_substream *substream,
                            RST_CTL_DIG_SW_RST_N_MASK, 0);
 }
 
-static struct snd_soc_dai_ops pm8916_wcd_analog_dai_ops = {
+static const struct snd_soc_dai_ops pm8916_wcd_analog_dai_ops = {
        .startup = pm8916_wcd_analog_startup,
        .shutdown = pm8916_wcd_analog_shutdown,
 };
index 3c5f555ae6d085122d63206b5776a554381e1387..c94e94fe8297877c75f929498628b5d5adf4b654 100644 (file)
@@ -1265,7 +1265,7 @@ static int rt5616_resume(struct snd_soc_codec *codec)
 #define RT5616_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 rt5616_aif_dai_ops = {
+static const struct snd_soc_dai_ops rt5616_aif_dai_ops = {
        .hw_params = rt5616_hw_params,
        .set_fmt = rt5616_set_dai_fmt,
        .set_sysclk = rt5616_set_dai_sysclk,
index ebc5e3b2b62b0b62b63a0805229c11bdb4fa229b..1bbe36338cd33db9677cb3e7b2cf20fb8f93c2bf 100644 (file)
@@ -2860,7 +2860,7 @@ static int rt5663_resume(struct snd_soc_codec *codec)
 #define RT5663_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 rt5663_aif_dai_ops = {
+static const struct snd_soc_dai_ops rt5663_aif_dai_ops = {
        .hw_params = rt5663_hw_params,
        .set_fmt = rt5663_set_dai_fmt,
        .set_sysclk = rt5663_set_dai_sysclk,
index d14b78b1917b31ee014ace4d535dcb89528f99c8..a736a2a6976c2fb6eefd2994c413ea35159b3724 100644 (file)
@@ -507,7 +507,7 @@ static const struct snd_soc_codec_driver soc_codec_dev_tas5720 = {
 #define TAS5720_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE |\
                         SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE)
 
-static struct snd_soc_dai_ops tas5720_speaker_dai_ops = {
+static const struct snd_soc_dai_ops tas5720_speaker_dai_ops = {
        .hw_params      = tas5720_hw_params,
        .set_fmt        = tas5720_set_dai_fmt,
        .set_tdm_slot   = tas5720_set_dai_tdm_slot,
index 36d0a7087a540ca967bae4303f8797952b47cadd..51fad48892d36ce1b37a22bef1788d655684db8e 100644 (file)
@@ -312,7 +312,7 @@ static int aud96p22_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
        return 0;
 }
 
-static struct snd_soc_dai_ops aud96p22_dai_ops = {
+static const struct snd_soc_dai_ops aud96p22_dai_ops = {
        .set_fmt = aud96p22_set_fmt,
 };