aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-06-23 08:37:59 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:36:48 -0400
commit746d4a02e68499fc6c1f8d0c43d2271853ade181 (patch)
treec4a1e9a0e8f5f95a44a3349d9b86490fe837428f /sound/core/pcm.c
parent42750b04c5baa7c5ffdf0a8be2b9b320efdf069f (diff)
[ALSA] Fix disconnection of proc interface
- Add the linked list to each proc entry to enable a single-shot disconnection (unregister) - Deprecate snd_info_unregister(), use snd_info_free_entry() - Removed NULL checks of snd_info_free_entry() Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r--sound/core/pcm.c53
1 files changed, 18 insertions, 35 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index 7581edd7b9ff..b8602471f7e5 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -494,19 +494,13 @@ static int snd_pcm_stream_proc_init(struct snd_pcm_str *pstr)
494static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr) 494static int snd_pcm_stream_proc_done(struct snd_pcm_str *pstr)
495{ 495{
496#ifdef CONFIG_SND_PCM_XRUN_DEBUG 496#ifdef CONFIG_SND_PCM_XRUN_DEBUG
497 if (pstr->proc_xrun_debug_entry) { 497 snd_info_free_entry(pstr->proc_xrun_debug_entry);
498 snd_info_unregister(pstr->proc_xrun_debug_entry); 498 pstr->proc_xrun_debug_entry = NULL;
499 pstr->proc_xrun_debug_entry = NULL;
500 }
501#endif 499#endif
502 if (pstr->proc_info_entry) { 500 snd_info_free_entry(pstr->proc_info_entry);
503 snd_info_unregister(pstr->proc_info_entry); 501 pstr->proc_info_entry = NULL;
504 pstr->proc_info_entry = NULL; 502 snd_info_free_entry(pstr->proc_root);
505 } 503 pstr->proc_root = NULL;
506 if (pstr->proc_root) {
507 snd_info_unregister(pstr->proc_root);
508 pstr->proc_root = NULL;
509 }
510 return 0; 504 return 0;
511} 505}
512 506
@@ -570,29 +564,19 @@ static int snd_pcm_substream_proc_init(struct snd_pcm_substream *substream)
570 564
571 return 0; 565 return 0;
572} 566}
573 567
574static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream) 568static int snd_pcm_substream_proc_done(struct snd_pcm_substream *substream)
575{ 569{
576 if (substream->proc_info_entry) { 570 snd_info_free_entry(substream->proc_info_entry);
577 snd_info_unregister(substream->proc_info_entry); 571 substream->proc_info_entry = NULL;
578 substream->proc_info_entry = NULL; 572 snd_info_free_entry(substream->proc_hw_params_entry);
579 } 573 substream->proc_hw_params_entry = NULL;
580 if (substream->proc_hw_params_entry) { 574 snd_info_free_entry(substream->proc_sw_params_entry);
581 snd_info_unregister(substream->proc_hw_params_entry); 575 substream->proc_sw_params_entry = NULL;
582 substream->proc_hw_params_entry = NULL; 576 snd_info_free_entry(substream->proc_status_entry);
583 } 577 substream->proc_status_entry = NULL;
584 if (substream->proc_sw_params_entry) { 578 snd_info_free_entry(substream->proc_root);
585 snd_info_unregister(substream->proc_sw_params_entry); 579 substream->proc_root = NULL;
586 substream->proc_sw_params_entry = NULL;
587 }
588 if (substream->proc_status_entry) {
589 snd_info_unregister(substream->proc_status_entry);
590 substream->proc_status_entry = NULL;
591 }
592 if (substream->proc_root) {
593 snd_info_unregister(substream->proc_root);
594 substream->proc_root = NULL;
595 }
596 return 0; 580 return 0;
597} 581}
598#else /* !CONFIG_SND_VERBOSE_PROCFS */ 582#else /* !CONFIG_SND_VERBOSE_PROCFS */
@@ -1090,8 +1074,7 @@ static void snd_pcm_proc_init(void)
1090 1074
1091static void snd_pcm_proc_done(void) 1075static void snd_pcm_proc_done(void)
1092{ 1076{
1093 if (snd_pcm_proc_entry) 1077 snd_info_free_entry(snd_pcm_proc_entry);
1094 snd_info_unregister(snd_pcm_proc_entry);
1095} 1078}
1096 1079
1097#else /* !CONFIG_PROC_FS */ 1080#else /* !CONFIG_PROC_FS */