Commit 41f394a8 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda: Constify snd_device_ops definitions

Now we may declare const for snd_device_ops definitions, so let's do
it for optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-9-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 99f664df
...@@ -192,7 +192,7 @@ static int beep_dev_free(struct snd_device *device) ...@@ -192,7 +192,7 @@ static int beep_dev_free(struct snd_device *device)
*/ */
int snd_hda_attach_beep_device(struct hda_codec *codec, int nid) int snd_hda_attach_beep_device(struct hda_codec *codec, int nid)
{ {
static struct snd_device_ops ops = { static const struct snd_device_ops ops = {
.dev_register = beep_dev_register, .dev_register = beep_dev_register,
.dev_disconnect = beep_dev_disconnect, .dev_disconnect = beep_dev_disconnect,
.dev_free = beep_dev_free, .dev_free = beep_dev_free,
......
...@@ -915,7 +915,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card, ...@@ -915,7 +915,7 @@ int snd_hda_codec_device_new(struct hda_bus *bus, struct snd_card *card,
char component[31]; char component[31];
hda_nid_t fg; hda_nid_t fg;
int err; int err;
static struct snd_device_ops dev_ops = { static const struct snd_device_ops dev_ops = {
.dev_register = snd_hda_codec_dev_register, .dev_register = snd_hda_codec_dev_register,
.dev_free = snd_hda_codec_dev_free, .dev_free = snd_hda_codec_dev_free,
}; };
......
...@@ -1743,7 +1743,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci, ...@@ -1743,7 +1743,7 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
int dev, unsigned int driver_caps, int dev, unsigned int driver_caps,
struct azx **rchip) struct azx **rchip)
{ {
static struct snd_device_ops ops = { static const struct snd_device_ops ops = {
.dev_disconnect = azx_dev_disconnect, .dev_disconnect = azx_dev_disconnect,
.dev_free = azx_dev_free, .dev_free = azx_dev_free,
}; };
......
...@@ -366,7 +366,7 @@ static int hda_tegra_create(struct snd_card *card, ...@@ -366,7 +366,7 @@ static int hda_tegra_create(struct snd_card *card,
unsigned int driver_caps, unsigned int driver_caps,
struct hda_tegra *hda) struct hda_tegra *hda)
{ {
static struct snd_device_ops ops = { static const struct snd_device_ops ops = {
.dev_disconnect = hda_tegra_dev_disconnect, .dev_disconnect = hda_tegra_dev_disconnect,
.dev_free = hda_tegra_dev_free, .dev_free = hda_tegra_dev_free,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment