ASoC: codecs: constify snd_soc_dai_ops structures
authorJulia Lawall <Julia.Lawall@lip6.fr>
Sat, 27 Oct 2018 13:34:44 +0000 (15:34 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 5 Nov 2018 11:25:42 +0000 (11:25 +0000)
The snd_soc_dai_ops structures are only stored in the ops field of a
snd_soc_dai_driver structure, so make the snd_soc_dai_ops structures
const as well.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/ak4458.c
sound/soc/codecs/ak5558.c
sound/soc/codecs/hdac_hda.c
sound/soc/codecs/tas6424.c

index 299ada4dfaa009f7cdc1d04f6b02ac13987597ae..70d4c89bd6fc38eb1794dfa9f80c4072f60f26d7 100644 (file)
@@ -456,7 +456,7 @@ static int ak4458_startup(struct snd_pcm_substream *substream,
        return ret;
 }
 
-static struct snd_soc_dai_ops ak4458_dai_ops = {
+static const struct snd_soc_dai_ops ak4458_dai_ops = {
        .startup        = ak4458_startup,
        .hw_params      = ak4458_hw_params,
        .set_fmt        = ak4458_set_dai_fmt,
index 448bb90c9c8e0aa7cac5df5b596b526c286ace04..60f1f12c81ea7877b3c7d4bec9321e202dac6e46 100644 (file)
@@ -246,7 +246,7 @@ static int ak5558_startup(struct snd_pcm_substream *substream,
                                          &ak5558_rate_constraints);
 }
 
-static struct snd_soc_dai_ops ak5558_dai_ops = {
+static const struct snd_soc_dai_ops ak5558_dai_ops = {
        .startup        = ak5558_startup,
        .hw_params      = ak5558_hw_params,
 
index 2aaa83028e55f28a45e55081f67bd6ba335da45c..ffecdaaa8cf2bb2e69bde2de7e2acb92cbdec0a1 100644 (file)
@@ -46,7 +46,7 @@ static int hdac_hda_dai_set_tdm_slot(struct snd_soc_dai *dai,
 static struct hda_pcm *snd_soc_find_pcm_from_dai(struct hdac_hda_priv *hda_pvt,
                                                 struct snd_soc_dai *dai);
 
-static struct snd_soc_dai_ops hdac_hda_dai_ops = {
+static const struct snd_soc_dai_ops hdac_hda_dai_ops = {
        .startup = hdac_hda_dai_open,
        .shutdown = hdac_hda_dai_close,
        .prepare = hdac_hda_dai_prepare,
index 36aebdb8f55c5b9540f421235f0c37ef815fd213..aaba3929507993d9e84206cbcae28e176258b9bf 100644 (file)
@@ -378,7 +378,7 @@ static struct snd_soc_component_driver soc_codec_dev_tas6424 = {
        .non_legacy_dai_naming  = 1,
 };
 
-static struct snd_soc_dai_ops tas6424_speaker_dai_ops = {
+static const struct snd_soc_dai_ops tas6424_speaker_dai_ops = {
        .hw_params      = tas6424_hw_params,
        .set_fmt        = tas6424_set_dai_fmt,
        .set_tdm_slot   = tas6424_set_dai_tdm_slot,