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:16:44 +0000 (13:16 +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>
12 files changed:
sound/soc/codecs/cs42l42.c
sound/soc/codecs/es8316.c
sound/soc/codecs/hdac_hdmi.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/msm8916-wcd-digital.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 ecc02449c569bd479d728aa929fc9093bf0a9fae..f5cf48c9c3b0f09952c6fac4ddb549ce3fcb278a 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 bc2e74ff3b2deddf653f1823329d22bf3449f8b6..e6de50acefd4b4654d769ab52087064962937c01 100644 (file)
@@ -1360,7 +1360,7 @@ static void hdac_hdmi_skl_enable_dp12(struct hdac_device *hdac)
 
 }
 
-static struct snd_soc_dai_ops hdmi_dai_ops = {
+static const struct snd_soc_dai_ops hdmi_dai_ops = {
        .startup = hdac_hdmi_pcm_open,
        .shutdown = hdac_hdmi_pcm_close,
        .hw_params = hdac_hdmi_set_hw_params,
index b918ba5c8ce5ce73acc35e843241b409113ea292..edf42d252fa1e4153927f1de3f8e8e94e0fc7034 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 2a40a69a7513817fe65753f774078f26e0aefec6..3e421e9d14a5ab82d8dba3bc190e0fe658c0dfd7 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 1eff7e0b092e1f5773fc88f7110cb71e37d80e44..f16145d8ee6b5278c6dad34218e9a47e41b2a8f6 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 a78802920c3cc098af2526a4ba335dba0df5a59f..aec1e1626993bcc10c044ab71847b0d17c000ca7 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 f690442af8c9409d21a6558ec910e672a6c8b4cb..7e3794fb8c2c558c7d574c1262b80419ddb19045 100644 (file)
@@ -788,7 +788,7 @@ static void msm8916_wcd_digital_shutdown(struct snd_pcm_substream *substream,
                            LPASS_CDC_CLK_PDM_CTL_PDM_CLK_SEL_MASK, 0);
 }
 
-static struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = {
+static const struct snd_soc_dai_ops msm8916_wcd_digital_dai_ops = {
        .startup = msm8916_wcd_digital_startup,
        .shutdown = msm8916_wcd_digital_shutdown,
        .hw_params = msm8916_wcd_digital_hw_params,
index 7d6e0823f98f12023d2e2f95a7734ec51a6bef68..33bdfe7c394abac4d7e655bf168b17911de2fddd 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 a33202affeb123aca338303d9d9c61bd7d5f5f39..af642c0fa28081e33aaf57892c0904507accfd6b 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 c65b917598d2e20e7a93f3759c86e1f59bdf15f4..01e9ed242378f6431d5c0fe62dbb8a54cc6d7f6f 100644 (file)
@@ -507,7 +507,7 @@ static 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 032fb7cf6cbdfce68f00577c41243561b9534742..855011e9e4d19a11d43b896b54131425308725e1 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,
 };