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/pcxhr | |
parent | ALSA: i2c: Clean up with new procfs helpers (diff) | |
download | linux-47f2769b4b2e267cba135fc19c89c32d202b1415.tar.xz linux-47f2769b4b2e267cba135fc19c89c32d202b1415.zip |
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/pcxhr')
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index e57da4036231..4ab7efc6e9f7 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c @@ -1454,21 +1454,14 @@ static void pcxhr_proc_ltc(struct snd_info_entry *entry, static void pcxhr_proc_init(struct snd_pcxhr *chip) { - struct snd_info_entry *entry; - - if (! snd_card_proc_new(chip->card, "info", &entry)) - snd_info_set_text_ops(entry, chip, pcxhr_proc_info); - if (! snd_card_proc_new(chip->card, "sync", &entry)) - snd_info_set_text_ops(entry, chip, pcxhr_proc_sync); + snd_card_ro_proc_new(chip->card, "info", chip, pcxhr_proc_info); + snd_card_ro_proc_new(chip->card, "sync", chip, pcxhr_proc_sync); /* gpio available on stereo sound cards only */ - if (chip->mgr->is_hr_stereo && - !snd_card_proc_new(chip->card, "gpio", &entry)) { - snd_info_set_text_ops(entry, chip, pcxhr_proc_gpio_read); - entry->c.text.write = pcxhr_proc_gpo_write; - entry->mode |= 0200; - } - if (!snd_card_proc_new(chip->card, "ltc", &entry)) - snd_info_set_text_ops(entry, chip, pcxhr_proc_ltc); + if (chip->mgr->is_hr_stereo) + snd_card_rw_proc_new(chip->card, "gpio", chip, + pcxhr_proc_gpio_read, + pcxhr_proc_gpo_write); + snd_card_ro_proc_new(chip->card, "ltc", chip, pcxhr_proc_ltc); } /* end of proc interface */ |