Skip to content

Commit

Permalink
ALSA: pci: Constify snd_device_ops definitions
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 3, 2020
1 parent 41f394a commit efb0ad2
Show file tree
Hide file tree
Showing 44 changed files with 45 additions and 45 deletions.
4 changes: 2 additions & 2 deletions sound/pci/ac97/ac97_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ int snd_ac97_bus(struct snd_card *card, int num, struct snd_ac97_bus_ops *ops,
{
int err;
struct snd_ac97_bus *bus;
static struct snd_device_ops dev_ops = {
static const struct snd_device_ops dev_ops = {
.dev_free = snd_ac97_bus_dev_free,
};

Expand Down Expand Up @@ -1999,7 +1999,7 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template,
unsigned long end_time;
unsigned int reg;
const struct ac97_codec_id *pid;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ac97_dev_free,
.dev_register = snd_ac97_dev_register,
.dev_disconnect = snd_ac97_dev_disconnect,
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ad1889.c
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ snd_ad1889_create(struct snd_card *card,
int err;

struct snd_ad1889 *chip;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ad1889_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ak4531_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ int snd_ak4531_mixer(struct snd_card *card,
unsigned int idx;
int err;
struct snd_ak4531 *ak4531;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ak4531_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ali5451/ali5451.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,7 +2046,7 @@ static int snd_ali_create(struct snd_card *card,
struct snd_ali *codec;
int i, err;
unsigned short cmdw;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ali_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/als300.c
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ static int snd_als300_create(struct snd_card *card,
void *irq_handler;
int err;

static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_als300_dev_free,
};
*rchip = NULL;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,7 @@ static int snd_atiixp_create(struct snd_card *card,
struct pci_dev *pci,
struct atiixp **r_chip)
{
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_atiixp_dev_free,
};
struct atiixp *chip;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/atiixp_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ static int snd_atiixp_create(struct snd_card *card,
struct pci_dev *pci,
struct atiixp_modem **r_chip)
{
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_atiixp_dev_free,
};
struct atiixp_modem *chip;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/au88x0/au88x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
{
vortex_t *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_vortex_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/aw2/aw2-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ static int snd_aw2_create(struct snd_card *card,
{
struct aw2 *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_aw2_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/azt3328.c
Original file line number Diff line number Diff line change
Expand Up @@ -2355,7 +2355,7 @@ snd_azf3328_create(struct snd_card *card,
{
struct snd_azf3328 *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_azf3328_dev_free,
};
u8 dma_init;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/bt87x.c
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ static int snd_bt87x_create(struct snd_card *card,
{
struct snd_bt87x *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_bt87x_dev_free
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ca0106/ca0106_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,7 @@ static int snd_ca0106_create(int dev, struct snd_card *card,
struct snd_ca0106 *chip;
struct snd_ca0106_details *c;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ca0106_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cmipci.c
Original file line number Diff line number Diff line change
Expand Up @@ -2976,7 +2976,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
{
struct cmipci *cm;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_cmipci_dev_free,
};
unsigned int val;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs4281.c
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ static int snd_cs4281_create(struct snd_card *card,
struct cs4281 *chip;
unsigned int tmp;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_cs4281_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs46xx/cs46xx_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -3864,7 +3864,7 @@ int snd_cs46xx_create(struct snd_card *card,
struct snd_cs46xx_region *region;
struct cs_card_type *cp;
u16 ss_card, ss_vendor;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_cs46xx_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs5530.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int snd_cs5530_create(struct snd_card *card,
void __iomem *mem;
int err;

static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_cs5530_dev_free,
};
*rchip = NULL;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/cs5535audio/cs5535audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ static int snd_cs5535audio_create(struct snd_card *card,
struct cs5535audio *cs5535au;

int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_cs5535audio_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ctxfi/ctatc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1669,7 +1669,7 @@ int ct_atc_create(struct snd_card *card, struct pci_dev *pci,
struct ct_atc **ratc)
{
struct ct_atc *atc;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = atc_dev_free,
};
int err;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/echoaudio/echoaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1856,7 +1856,7 @@ static int snd_echo_create(struct snd_card *card,
struct echoaudio *chip;
int err;
size_t sz;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_echo_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/emu10k1_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1791,7 +1791,7 @@ int snd_emu10k1_create(struct snd_card *card,
size_t page_table_size;
unsigned int silent_page;
const struct snd_emu_chip_details *c;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_emu10k1_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/emu10k1/emu10k1x.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ static int snd_emu10k1x_create(struct snd_card *card,
struct emu10k1x *chip;
int err;
int ch;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_emu10k1x_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ens1370.c
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,7 @@ static int snd_ensoniq_create(struct snd_card *card,
{
struct ensoniq *ensoniq;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ensoniq_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/es1938.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ static int snd_es1938_create(struct snd_card *card,
{
struct es1938 *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_es1938_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/es1968.c
Original file line number Diff line number Diff line change
Expand Up @@ -2656,7 +2656,7 @@ static int snd_es1968_create(struct snd_card *card,
int radio_nr,
struct es1968 **chip_ret)
{
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_es1968_dev_free,
};
struct es1968 *chip;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/fm801.c
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ static int snd_fm801_create(struct snd_card *card,
{
struct fm801 *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_fm801_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -2474,7 +2474,7 @@ static int snd_ice1712_create(struct snd_card *card,
{
struct snd_ice1712 *ice;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_ice1712_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -2502,7 +2502,7 @@ static int snd_vt1724_create(struct snd_card *card,
{
struct snd_ice1712 *ice;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_vt1724_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2897,7 +2897,7 @@ static int snd_intel8x0_create(struct snd_card *card,
unsigned int i;
unsigned int int_sta_masks;
struct ichdev *ichdev;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_intel8x0_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/intel8x0m.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static int snd_intel8x0m_create(struct snd_card *card,
unsigned int i;
unsigned int int_sta_masks;
struct ichdev *ichdev;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_intel8x0m_dev_free,
};
static struct ich_reg_info intel_regs[2] = {
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/korg1212/korg1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,7 +2153,7 @@ static int snd_korg1212_create(struct snd_card *card, struct pci_dev *pci,
struct snd_korg1212 * korg1212;
const struct firmware *dsp_code;

static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_korg1212_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/lola/lola.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ static int lola_create(struct snd_card *card, struct pci_dev *pci,
struct lola *chip;
int err;
unsigned int dever;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = lola_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/lx6464es/lx6464es.c
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,7 @@ static int snd_lx6464es_create(struct snd_card *card,
struct lx6464es *chip;
int err;

static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_lx6464es_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/maestro3.c
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ snd_m3_create(struct snd_card *card, struct pci_dev *pci,
struct snd_m3 *chip;
int i, err;
const struct snd_pci_quirk *quirk;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_m3_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/mixart/mixart.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ static int snd_mixart_create(struct mixart_mgr *mgr, struct snd_card *card, int
{
int err;
struct snd_mixart *chip;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_mixart_chip_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/nm256/nm256.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ snd_nm256_create(struct snd_card *card, struct pci_dev *pci,
{
struct nm256 *chip;
int err, pval;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_nm256_dev_free,
};
u32 addr;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/pcxhr/pcxhr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1179,7 +1179,7 @@ static int pcxhr_create(struct pcxhr_mgr *mgr,
{
int err;
struct snd_pcxhr *chip;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = pcxhr_chip_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/riptide/riptide.c
Original file line number Diff line number Diff line change
Expand Up @@ -1824,7 +1824,7 @@ snd_riptide_create(struct snd_card *card, struct pci_dev *pci,
struct snd_riptide *chip;
struct riptideport *hwport;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_riptide_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/sis7019.c
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@ static int sis_chip_create(struct snd_card *card,
{
struct sis7019 *sis = card->private_data;
struct voice *voice;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = sis_dev_free,
};
int rc;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/sonicvibes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,7 @@ static int snd_sonicvibes_create(struct snd_card *card,
struct sonicvibes *sonic;
unsigned int dmaa, dmac;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_sonicvibes_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/trident/trident_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3487,7 +3487,7 @@ int snd_trident_create(struct snd_card *card,
int i, err;
struct snd_trident_voice *voice;
struct snd_trident_pcm_mixer *tmix;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_trident_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/via82xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@ static int snd_via82xx_create(struct snd_card *card,
{
struct via82xx *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_via82xx_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/via82xx_modem.c
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ static int snd_via82xx_create(struct snd_card *card,
{
struct via82xx_modem *chip;
int err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_via82xx_dev_free,
};

Expand Down
2 changes: 1 addition & 1 deletion sound/pci/vx222/vx222.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int snd_vx222_create(struct snd_card *card, struct pci_dev *pci,
struct vx_core *chip;
struct snd_vx222 *vx;
int i, err;
static struct snd_device_ops ops = {
static const struct snd_device_ops ops = {
.dev_free = snd_vx222_dev_free,
};
struct snd_vx_ops *vx_ops;
Expand Down
Loading

0 comments on commit efb0ad2

Please sign in to comment.