From 19260818a9747768b09c1c1f10b4125b4d00595e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 3 Jan 2020 09:16:38 +0100 Subject: ALSA: ac97: Treat snd_ac97_bus_ops as const This is a preliminary patch to allow const for snd_ac97_bus_ops definitions in each driver's code. The ops reference is read-only, hence it can be declared as const for further optimization. There should be no functional changes by this patch. Link: https://lore.kernel.org/r/20200103081714.9560-23-tiwai@suse.de Signed-off-by: Takashi Iwai --- include/sound/ac97_codec.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index cc383991c0fe..49200ec26dc4 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h @@ -197,7 +197,7 @@ struct snd_ac97_bus_ops { struct snd_ac97_bus { /* -- lowlevel (hardware) driver specific -- */ - struct snd_ac97_bus_ops *ops; + const struct snd_ac97_bus_ops *ops; void *private_data; void (*private_free) (struct snd_ac97_bus *bus); /* --- */ @@ -310,7 +310,8 @@ static inline int ac97_can_spdif(struct snd_ac97 * ac97) /* functions */ /* create new AC97 bus */ -int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops, +int snd_ac97_bus(struct snd_card *card, int num, + const struct snd_ac97_bus_ops *ops, void *private_data, struct snd_ac97_bus **rbus); /* create mixer controls */ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, -- cgit v1.2.3