ASoC: codecs: constify snd_soc_dai_ops structures

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>
This commit is contained in:
Arvind Yadav 2017-08-18 17:35:59 +05:30 committed by Mark Brown
parent 6e37f933ed
commit eb59d73cb5
10 changed files with 10 additions and 10 deletions

View File

@ -911,7 +911,7 @@ static int cs42l42_digital_mute(struct snd_soc_dai *dai, int mute)
SNDRV_PCM_FMTBIT_S32_LE) 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, .hw_params = cs42l42_pcm_hw_params,
.set_fmt = cs42l42_set_dai_fmt, .set_fmt = cs42l42_set_dai_fmt,
.set_sysclk = cs42l42_set_sysclk, .set_sysclk = cs42l42_set_sysclk,

View 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 | \ #define ES8316_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE) 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, .startup = es8316_pcm_startup,
.hw_params = es8316_pcm_hw_params, .hw_params = es8316_pcm_hw_params,
.set_fmt = es8316_set_dai_fmt, .set_fmt = es8316_set_dai_fmt,

View 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_S24_LE | \
SNDRV_PCM_FMTBIT_S32_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, .set_fmt = rk3036_codec_dai_set_fmt,
.hw_params = rk3036_codec_dai_hw_params, .hw_params = rk3036_codec_dai_hw_params,
}; };

View File

@ -350,7 +350,7 @@ static int max9867_dai_set_fmt(struct snd_soc_dai *codec_dai,
return 0; 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_fmt = max9867_dai_set_fmt,
.set_sysclk = max9867_set_dai_sysclk, .set_sysclk = max9867_set_dai_sysclk,
.prepare = max9867_prepare, .prepare = max9867_prepare,

View File

@ -459,7 +459,7 @@ static int max98926_dai_hw_params(struct snd_pcm_substream *substream,
#define MAX98926_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ #define MAX98926_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_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, .set_fmt = max98926_dai_set_fmt,
.hw_params = max98926_dai_hw_params, .hw_params = max98926_dai_hw_params,
}; };

View File

@ -753,7 +753,7 @@ static void pm8916_wcd_analog_shutdown(struct snd_pcm_substream *substream,
RST_CTL_DIG_SW_RST_N_MASK, 0); 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, .startup = pm8916_wcd_analog_startup,
.shutdown = pm8916_wcd_analog_shutdown, .shutdown = pm8916_wcd_analog_shutdown,
}; };

View 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 | \ #define RT5616_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) 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, .hw_params = rt5616_hw_params,
.set_fmt = rt5616_set_dai_fmt, .set_fmt = rt5616_set_dai_fmt,
.set_sysclk = rt5616_set_dai_sysclk, .set_sysclk = rt5616_set_dai_sysclk,

View 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 | \ #define RT5663_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | \
SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S8) 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, .hw_params = rt5663_hw_params,
.set_fmt = rt5663_set_dai_fmt, .set_fmt = rt5663_set_dai_fmt,
.set_sysclk = rt5663_set_dai_sysclk, .set_sysclk = rt5663_set_dai_sysclk,

View 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 |\ #define TAS5720_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE |\
SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE) 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, .hw_params = tas5720_hw_params,
.set_fmt = tas5720_set_dai_fmt, .set_fmt = tas5720_set_dai_fmt,
.set_tdm_slot = tas5720_set_dai_tdm_slot, .set_tdm_slot = tas5720_set_dai_tdm_slot,

View File

@ -312,7 +312,7 @@ static int aud96p22_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return 0; 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, .set_fmt = aud96p22_set_fmt,
}; };