summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ac97.c
diff options
context:
space:
mode:
authorBhumika Goyal2017-08-03 18:00:19 +0200
committerMark Brown2017-08-10 17:10:50 +0200
commita180ba45b1cf630b3bd5912ce235b2ee16606b8e (patch)
tree7357cb3beb7fa05c24bc9a472f34c5e8a8daabb1 /sound/soc/codecs/ac97.c
parentMerge branches 'topic/rt274', 'topic/hdmi' and 'topic/msm8916' of git://git.k... (diff)
downloadkernel-qcow2-linux-a180ba45b1cf630b3bd5912ce235b2ee16606b8e.tar.gz
kernel-qcow2-linux-a180ba45b1cf630b3bd5912ce235b2ee16606b8e.tar.xz
kernel-qcow2-linux-a180ba45b1cf630b3bd5912ce235b2ee16606b8e.zip
ASoC: codecs: add const to snd_soc_codec_driver structures
Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/ac97.c')
-rw-r--r--sound/soc/codecs/ac97.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index f7f04c6be01e..440b4ce54376 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -112,7 +112,7 @@ static int ac97_soc_resume(struct snd_soc_codec *codec)
#define ac97_soc_resume NULL
#endif
-static struct snd_soc_codec_driver soc_codec_dev_ac97 = {
+static const struct snd_soc_codec_driver soc_codec_dev_ac97 = {
.probe = ac97_soc_probe,
.suspend = ac97_soc_suspend,
.resume = ac97_soc_resume,