Skip to content

Commit

Permalink
ALSA: sparc: Clean up with new procfs helpers
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Feb 6, 2019
1 parent 50a7a8e commit 3c6ee77
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions sound/sparc/dbri.c
Original file line number Diff line number Diff line change
Expand Up @@ -2510,16 +2510,10 @@ static void dbri_debug_read(struct snd_info_entry *entry,
static void snd_dbri_proc(struct snd_card *card)
{
struct snd_dbri *dbri = card->private_data;
struct snd_info_entry *entry;

if (!snd_card_proc_new(card, "regs", &entry))
snd_info_set_text_ops(entry, dbri, dbri_regs_read);

snd_card_ro_proc_new(card, "regs", dbri, dbri_regs_read);
#ifdef DBRI_DEBUG
if (!snd_card_proc_new(card, "debug", &entry)) {
snd_info_set_text_ops(entry, dbri, dbri_debug_read);
entry->mode = S_IFREG | 0444; /* Readable only. */
}
snd_card_ro_proc_new(card, "debug", dbri, dbri_debug_read);
#endif
}

Expand Down

0 comments on commit 3c6ee77

Please sign in to comment.