diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-02-04 16:07:35 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-02-06 18:11:57 +0100 |
commit | 7449054af0dcfa2839bb2da0a393bd35cf08daff (patch) | |
tree | 3b83650e4a1b82e7c922b4658f9d815542386267 /sound/usb/proc.c | |
parent | 3c6ee77088a9b5188d065780b1c540f5e3d879c8 (diff) | |
download | linux-7449054af0dcfa2839bb2da0a393bd35cf08daff.tar.bz2 |
ALSA: usb: 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/usb/proc.c')
-rw-r--r-- | sound/usb/proc.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/sound/usb/proc.c b/sound/usb/proc.c index 0ac89e294d31..e80c9d0749c9 100644 --- a/sound/usb/proc.c +++ b/sound/usb/proc.c @@ -61,11 +61,10 @@ static void proc_audio_usbid_read(struct snd_info_entry *entry, struct snd_info_ void snd_usb_audio_create_proc(struct snd_usb_audio *chip) { - struct snd_info_entry *entry; - if (!snd_card_proc_new(chip->card, "usbbus", &entry)) - snd_info_set_text_ops(entry, chip, proc_audio_usbbus_read); - if (!snd_card_proc_new(chip->card, "usbid", &entry)) - snd_info_set_text_ops(entry, chip, proc_audio_usbid_read); + snd_card_ro_proc_new(chip->card, "usbbus", chip, + proc_audio_usbbus_read); + snd_card_ro_proc_new(chip->card, "usbid", chip, + proc_audio_usbid_read); } /* @@ -167,12 +166,10 @@ static void proc_pcm_format_read(struct snd_info_entry *entry, struct snd_info_b void snd_usb_proc_pcm_format_add(struct snd_usb_stream *stream) { - struct snd_info_entry *entry; char name[32]; struct snd_card *card = stream->chip->card; sprintf(name, "stream%d", stream->pcm_index); - if (!snd_card_proc_new(card, name, &entry)) - snd_info_set_text_ops(entry, stream, proc_pcm_format_read); + snd_card_ro_proc_new(card, name, stream, proc_pcm_format_read); } |