Skip to content

Commit 6e37f93

Browse files
goyalbhumikabroonie
authored andcommitted
ASoC: codecs: make snd_soc_dai_driver and snd_soc_component_driver const
Make these two structure variables const as they are either used in a copy operation or passed to devm_snd_soc_register_component having the corresponding argument as const. Done using Coccinelle. Signed-off-by: Bhumika Goyal <[email protected]> Signed-off-by: Mark Brown <[email protected]>
1 parent 0ed6f15 commit 6e37f93

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

sound/soc/codecs/hdmi-codec.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ static int hdmi_codec_pcm_new(struct snd_soc_pcm_runtime *rtd,
692692
return snd_ctl_add(rtd->card->snd_card, kctl);
693693
}
694694

695-
static struct snd_soc_dai_driver hdmi_i2s_dai = {
695+
static const struct snd_soc_dai_driver hdmi_i2s_dai = {
696696
.name = "i2s-hifi",
697697
.id = DAI_ID_I2S,
698698
.playback = {

sound/soc/codecs/lm4857.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ static const struct snd_soc_dapm_route lm4857_routes[] = {
100100
{ "EP", "Earpiece", "Mode" },
101101
};
102102

103-
static struct snd_soc_component_driver lm4857_component_driver = {
103+
static const struct snd_soc_component_driver lm4857_component_driver = {
104104
.controls = lm4857_controls,
105105
.num_controls = ARRAY_SIZE(lm4857_controls),
106106
.dapm_widgets = lm4857_dapm_widgets,

sound/soc/codecs/max9768.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int max9768_probe(struct snd_soc_component *component)
151151
return 0;
152152
}
153153

154-
static struct snd_soc_component_driver max9768_component_driver = {
154+
static const struct snd_soc_component_driver max9768_component_driver = {
155155
.probe = max9768_probe,
156156
.controls = max9768_volume,
157157
.num_controls = ARRAY_SIZE(max9768_volume),

0 commit comments

Comments
 (0)