aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-04-22 12:26:38 -0400
committerTakashi Iwai <tiwai@suse.de>2015-04-24 11:27:57 -0400
commitc560a6797e3bec1e04f1f6f9f3c2135db0f5c8ee (patch)
tree433dd8c4dd8c53ef7ebe4411f6dbdae7b1e9b74d /include/sound
parent886364f679342a381c9cb4a0b2588fb103bb6a22 (diff)
ALSA: core: Remove child proc file elements recursively
This patch changes the way to manage the resource release of proc files: namely, let snd_info_free_entry() freeing the whole children. This makes it us possible to drop the snd_device_*() management. Then snd_card_proc_new() becomes merely a wrapper to snd_info_create_card_entry(). Together with this change, now you need to call snd_info_free_entry() for a proc entry created via snd_card_proc_new(), while it was freed via snd_device_free() beforehand. Acked-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include/sound')
-rw-r--r--include/sound/info.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/sound/info.h b/include/sound/info.h
index ff8962ebece5..3e2fda3c75ee 100644
--- a/include/sound/info.h
+++ b/include/sound/info.h
@@ -24,6 +24,7 @@
24 24
25#include <linux/poll.h> 25#include <linux/poll.h>
26#include <linux/seq_file.h> 26#include <linux/seq_file.h>
27#include <sound/core.h>
27 28
28/* buffer for information */ 29/* buffer for information */
29struct snd_info_buffer { 30struct snd_info_buffer {
@@ -146,8 +147,12 @@ void snd_info_card_id_change(struct snd_card *card);
146int snd_info_register(struct snd_info_entry *entry); 147int snd_info_register(struct snd_info_entry *entry);
147 148
148/* for card drivers */ 149/* for card drivers */
149int snd_card_proc_new(struct snd_card *card, const char *name, 150static inline int snd_card_proc_new(struct snd_card *card, const char *name,
150 struct snd_info_entry **entryp); 151 struct snd_info_entry **entryp)
152{
153 *entryp = snd_info_create_card_entry(card, name, card->proc_root);
154 return *entryp ? 0 : -ENOMEM;
155}
151 156
152static inline void snd_info_set_text_ops(struct snd_info_entry *entry, 157static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
153 void *private_data, 158 void *private_data,