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>
このコミットが含まれているのは:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <linux/poll.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <sound/core.h>
|
||||
|
||||
/* buffer for information */
|
||||
struct snd_info_buffer {
|
||||
@@ -146,8 +147,12 @@ void snd_info_card_id_change(struct snd_card *card);
|
||||
int snd_info_register(struct snd_info_entry *entry);
|
||||
|
||||
/* for card drivers */
|
||||
int snd_card_proc_new(struct snd_card *card, const char *name,
|
||||
struct snd_info_entry **entryp);
|
||||
static inline int snd_card_proc_new(struct snd_card *card, const char *name,
|
||||
struct snd_info_entry **entryp)
|
||||
{
|
||||
*entryp = snd_info_create_card_entry(card, name, card->proc_root);
|
||||
return *entryp ? 0 : -ENOMEM;
|
||||
}
|
||||
|
||||
static inline void snd_info_set_text_ops(struct snd_info_entry *entry,
|
||||
void *private_data,
|
||||
|
新しいイシューから参照
ユーザーをブロックする