diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-02-04 16:01:39 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-02-06 18:11:56 +0100 |
commit | 47f2769b4b2e267cba135fc19c89c32d202b1415 (patch) | |
tree | 58078c2d663d901622b6015bbfde465e2dda7e8f /sound/pci/ice1712 | |
parent | 5a170e9e4c74bc7f9aa57861c90e5813d63bfdab (diff) |
ALSA: pci: Clean up with new procfs helpers
Simplify the proc fs creation code with new helper functions,
snd_card_ro_proc_new() and snd_card_rw_proc_new().
Just a code refactoring and no functional changes.
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/ice1712')
-rw-r--r-- | sound/pci/ice1712/ice1712.c | 5 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 5 | ||||
-rw-r--r-- | sound/pci/ice1712/pontis.c | 12 | ||||
-rw-r--r-- | sound/pci/ice1712/prodigy192.c | 5 | ||||
-rw-r--r-- | sound/pci/ice1712/prodigy_hifi.c | 8 | ||||
-rw-r--r-- | sound/pci/ice1712/quartet.c | 4 |
6 files changed, 10 insertions, 29 deletions
diff --git a/sound/pci/ice1712/ice1712.c b/sound/pci/ice1712/ice1712.c index dda9b26192cb..fa7d90ee6e2d 100644 --- a/sound/pci/ice1712/ice1712.c +++ b/sound/pci/ice1712/ice1712.c @@ -1603,10 +1603,7 @@ static void snd_ice1712_proc_read(struct snd_info_entry *entry, static void snd_ice1712_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - - if (!snd_card_proc_new(ice->card, "ice1712", &entry)) - snd_info_set_text_ops(entry, ice, snd_ice1712_proc_read); + snd_card_ro_proc_new(ice->card, "ice1712", ice, snd_ice1712_proc_read); } /* diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 42994cf36156..a7d640ee4a17 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c @@ -1571,10 +1571,7 @@ static void snd_vt1724_proc_read(struct snd_info_entry *entry, static void snd_vt1724_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - - if (!snd_card_proc_new(ice->card, "ice1724", &entry)) - snd_info_set_text_ops(entry, ice, snd_vt1724_proc_read); + snd_card_ro_proc_new(ice->card, "ice1724", ice, snd_vt1724_proc_read); } /* diff --git a/sound/pci/ice1712/pontis.c b/sound/pci/ice1712/pontis.c index 93b8cfc6636f..f499f1e8d0c9 100644 --- a/sound/pci/ice1712/pontis.c +++ b/sound/pci/ice1712/pontis.c @@ -659,12 +659,8 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff static void wm_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - if (! snd_card_proc_new(ice->card, "wm_codec", &entry)) { - snd_info_set_text_ops(entry, ice, wm_proc_regs_read); - entry->mode |= 0200; - entry->c.text.write = wm_proc_regs_write; - } + snd_card_rw_proc_new(ice->card, "wm_codec", ice, wm_proc_regs_read, + wm_proc_regs_write); } static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer) @@ -684,9 +680,7 @@ static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buff static void cs_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - if (! snd_card_proc_new(ice->card, "cs_codec", &entry)) - snd_info_set_text_ops(entry, ice, cs_proc_regs_read); + snd_card_ro_proc_new(ice->card, "cs_codec", ice, cs_proc_regs_read); } diff --git a/sound/pci/ice1712/prodigy192.c b/sound/pci/ice1712/prodigy192.c index 3919aed39ca0..d243309029d3 100644 --- a/sound/pci/ice1712/prodigy192.c +++ b/sound/pci/ice1712/prodigy192.c @@ -651,9 +651,8 @@ static void stac9460_proc_regs_read(struct snd_info_entry *entry, static void stac9460_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - if (!snd_card_proc_new(ice->card, "stac9460_codec", &entry)) - snd_info_set_text_ops(entry, ice, stac9460_proc_regs_read); + snd_card_ro_proc_new(ice->card, "stac9460_codec", ice, + stac9460_proc_regs_read); } diff --git a/sound/pci/ice1712/prodigy_hifi.c b/sound/pci/ice1712/prodigy_hifi.c index c97b5528e4b8..72f252c936e5 100644 --- a/sound/pci/ice1712/prodigy_hifi.c +++ b/sound/pci/ice1712/prodigy_hifi.c @@ -904,12 +904,8 @@ static void wm_proc_regs_read(struct snd_info_entry *entry, static void wm_proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - if (!snd_card_proc_new(ice->card, "wm_codec", &entry)) { - snd_info_set_text_ops(entry, ice, wm_proc_regs_read); - entry->mode |= 0200; - entry->c.text.write = wm_proc_regs_write; - } + snd_card_rw_proc_new(ice->card, "wm_codec", ice, wm_proc_regs_read, + wm_proc_regs_write); } static int prodigy_hifi_add_controls(struct snd_ice1712 *ice) diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 5bc836241c97..8ad964ee0b65 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c @@ -502,9 +502,7 @@ static void proc_regs_read(struct snd_info_entry *entry, static void proc_init(struct snd_ice1712 *ice) { - struct snd_info_entry *entry; - if (!snd_card_proc_new(ice->card, "quartet", &entry)) - snd_info_set_text_ops(entry, ice, proc_regs_read); + snd_card_ro_proc_new(ice->card, "quartet", ice, proc_regs_read); } static int qtet_mute_get(struct snd_kcontrol *kcontrol, |