diff options
author | Takashi Iwai <tiwai@suse.de> | 2006-06-23 08:37:59 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-09-23 04:36:48 -0400 |
commit | 746d4a02e68499fc6c1f8d0c43d2271853ade181 (patch) | |
tree | c4a1e9a0e8f5f95a44a3349d9b86490fe837428f /sound/pci | |
parent | 42750b04c5baa7c5ffdf0a8be2b9b320efdf069f (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/pci')
-rw-r--r-- | sound/pci/ac97/ac97_proc.c | 18 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos.c | 52 | ||||
-rw-r--r-- | sound/pci/cs46xx/dsp_spos_scb_lib.c | 2 |
3 files changed, 26 insertions, 46 deletions
diff --git a/sound/pci/ac97/ac97_proc.c b/sound/pci/ac97/ac97_proc.c index 2118df50b9d6..a3fdd7da911c 100644 --- a/sound/pci/ac97/ac97_proc.c +++ b/sound/pci/ac97/ac97_proc.c | |||
@@ -457,14 +457,10 @@ void snd_ac97_proc_init(struct snd_ac97 * ac97) | |||
457 | 457 | ||
458 | void snd_ac97_proc_done(struct snd_ac97 * ac97) | 458 | void snd_ac97_proc_done(struct snd_ac97 * ac97) |
459 | { | 459 | { |
460 | if (ac97->proc_regs) { | 460 | snd_info_free_entry(ac97->proc_regs); |
461 | snd_info_unregister(ac97->proc_regs); | 461 | ac97->proc_regs = NULL; |
462 | ac97->proc_regs = NULL; | 462 | snd_info_free_entry(ac97->proc); |
463 | } | 463 | ac97->proc = NULL; |
464 | if (ac97->proc) { | ||
465 | snd_info_unregister(ac97->proc); | ||
466 | ac97->proc = NULL; | ||
467 | } | ||
468 | } | 464 | } |
469 | 465 | ||
470 | void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus) | 466 | void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus) |
@@ -485,8 +481,6 @@ void snd_ac97_bus_proc_init(struct snd_ac97_bus * bus) | |||
485 | 481 | ||
486 | void snd_ac97_bus_proc_done(struct snd_ac97_bus * bus) | 482 | void snd_ac97_bus_proc_done(struct snd_ac97_bus * bus) |
487 | { | 483 | { |
488 | if (bus->proc) { | 484 | snd_info_free_entry(bus->proc); |
489 | snd_info_unregister(bus->proc); | 485 | bus->proc = NULL; |
490 | bus->proc = NULL; | ||
491 | } | ||
492 | } | 486 | } |
diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index 5c9711c0265c..89c402770a1d 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c | |||
@@ -868,35 +868,23 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) | |||
868 | struct dsp_spos_instance * ins = chip->dsp_spos_instance; | 868 | struct dsp_spos_instance * ins = chip->dsp_spos_instance; |
869 | int i; | 869 | int i; |
870 | 870 | ||
871 | if (ins->proc_sym_info_entry) { | 871 | snd_info_free_entry(ins->proc_sym_info_entry); |
872 | snd_info_unregister(ins->proc_sym_info_entry); | 872 | ins->proc_sym_info_entry = NULL; |
873 | ins->proc_sym_info_entry = NULL; | 873 | |
874 | } | 874 | snd_info_free_entry(ins->proc_modules_info_entry); |
875 | 875 | ins->proc_modules_info_entry = NULL; | |
876 | if (ins->proc_modules_info_entry) { | 876 | |
877 | snd_info_unregister(ins->proc_modules_info_entry); | 877 | snd_info_free_entry(ins->proc_parameter_dump_info_entry); |
878 | ins->proc_modules_info_entry = NULL; | 878 | ins->proc_parameter_dump_info_entry = NULL; |
879 | } | 879 | |
880 | 880 | snd_info_free_entry(ins->proc_sample_dump_info_entry); | |
881 | if (ins->proc_parameter_dump_info_entry) { | 881 | ins->proc_sample_dump_info_entry = NULL; |
882 | snd_info_unregister(ins->proc_parameter_dump_info_entry); | 882 | |
883 | ins->proc_parameter_dump_info_entry = NULL; | 883 | snd_info_free_entry(ins->proc_scb_info_entry); |
884 | } | 884 | ins->proc_scb_info_entry = NULL; |
885 | 885 | ||
886 | if (ins->proc_sample_dump_info_entry) { | 886 | snd_info_free_entry(ins->proc_task_info_entry); |
887 | snd_info_unregister(ins->proc_sample_dump_info_entry); | 887 | ins->proc_task_info_entry = NULL; |
888 | ins->proc_sample_dump_info_entry = NULL; | ||
889 | } | ||
890 | |||
891 | if (ins->proc_scb_info_entry) { | ||
892 | snd_info_unregister(ins->proc_scb_info_entry); | ||
893 | ins->proc_scb_info_entry = NULL; | ||
894 | } | ||
895 | |||
896 | if (ins->proc_task_info_entry) { | ||
897 | snd_info_unregister(ins->proc_task_info_entry); | ||
898 | ins->proc_task_info_entry = NULL; | ||
899 | } | ||
900 | 888 | ||
901 | mutex_lock(&chip->spos_mutex); | 889 | mutex_lock(&chip->spos_mutex); |
902 | for (i = 0; i < ins->nscb; ++i) { | 890 | for (i = 0; i < ins->nscb; ++i) { |
@@ -905,10 +893,8 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) | |||
905 | } | 893 | } |
906 | mutex_unlock(&chip->spos_mutex); | 894 | mutex_unlock(&chip->spos_mutex); |
907 | 895 | ||
908 | if (ins->proc_dsp_dir) { | 896 | snd_info_free_entry(ins->proc_dsp_dir); |
909 | snd_info_unregister (ins->proc_dsp_dir); | 897 | ins->proc_dsp_dir = NULL; |
910 | ins->proc_dsp_dir = NULL; | ||
911 | } | ||
912 | 898 | ||
913 | return 0; | 899 | return 0; |
914 | } | 900 | } |
diff --git a/sound/pci/cs46xx/dsp_spos_scb_lib.c b/sound/pci/cs46xx/dsp_spos_scb_lib.c index 232b337852ff..343f51d5311b 100644 --- a/sound/pci/cs46xx/dsp_spos_scb_lib.c +++ b/sound/pci/cs46xx/dsp_spos_scb_lib.c | |||
@@ -233,7 +233,7 @@ void cs46xx_dsp_proc_free_scb_desc (struct dsp_scb_descriptor * scb) | |||
233 | 233 | ||
234 | snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name); | 234 | snd_printdd("cs46xx_dsp_proc_free_scb_desc: freeing %s\n",scb->scb_name); |
235 | 235 | ||
236 | snd_info_unregister(scb->proc_info); | 236 | snd_info_free_entry(scb->proc_info); |
237 | scb->proc_info = NULL; | 237 | scb->proc_info = NULL; |
238 | 238 | ||
239 | snd_assert (scb_info != NULL, return); | 239 | snd_assert (scb_info != NULL, return); |