Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: core: Remove superfluous exit calls for proc entries

Since each proc entry is freed automatically by the parent, we don't
have to take care of its life cycle any longer. This allows us to
reduce a few more lines of codes.

Acked-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

+1 -47
-4
include/sound/core.h
··· 224 224 #endif 225 225 226 226 int snd_minor_info_init(void); 227 - int snd_minor_info_done(void); 228 227 229 228 /* sound_oss.c */ 230 229 231 230 #ifdef CONFIG_SND_OSSEMUL 232 231 int snd_minor_info_oss_init(void); 233 - int snd_minor_info_oss_done(void); 234 232 #else 235 233 static inline int snd_minor_info_oss_init(void) { return 0; } 236 - static inline int snd_minor_info_oss_done(void) { return 0; } 237 234 #endif 238 235 239 236 /* memory.c */ ··· 259 262 void snd_card_set_id(struct snd_card *card, const char *id); 260 263 int snd_card_register(struct snd_card *card); 261 264 int snd_card_info_init(void); 262 - int snd_card_info_done(void); 263 265 int snd_card_add_dev_attr(struct snd_card *card, 264 266 const struct attribute_group *group); 265 267 int snd_component_add(struct snd_card *card, const char *component);
-3
sound/core/info.c
··· 495 495 496 496 int __exit snd_info_done(void) 497 497 { 498 - snd_card_info_done(); 499 - snd_minor_info_oss_done(); 500 - snd_minor_info_done(); 501 498 snd_info_free_entry(snd_proc_root); 502 499 return 0; 503 500 }
-17
sound/core/init.c
··· 783 783 EXPORT_SYMBOL(snd_card_register); 784 784 785 785 #ifdef CONFIG_PROC_FS 786 - static struct snd_info_entry *snd_card_info_entry; 787 - 788 786 static void snd_card_info_read(struct snd_info_entry *entry, 789 787 struct snd_info_buffer *buffer) 790 788 { ··· 808 810 } 809 811 810 812 #ifdef CONFIG_SND_OSSEMUL 811 - 812 813 void snd_card_info_read_oss(struct snd_info_buffer *buffer) 813 814 { 814 815 int idx, count; ··· 829 832 #endif 830 833 831 834 #ifdef MODULE 832 - static struct snd_info_entry *snd_card_module_info_entry; 833 835 static void snd_card_module_info_read(struct snd_info_entry *entry, 834 836 struct snd_info_buffer *buffer) 835 837 { ··· 857 861 snd_info_free_entry(entry); 858 862 return -ENOMEM; 859 863 } 860 - snd_card_info_entry = entry; 861 864 862 865 #ifdef MODULE 863 866 entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL); ··· 864 869 entry->c.text.read = snd_card_module_info_read; 865 870 if (snd_info_register(entry) < 0) 866 871 snd_info_free_entry(entry); 867 - else 868 - snd_card_module_info_entry = entry; 869 872 } 870 873 #endif 871 874 872 875 return 0; 873 876 } 874 - 875 - int __exit snd_card_info_done(void) 876 - { 877 - snd_info_free_entry(snd_card_info_entry); 878 - #ifdef MODULE 879 - snd_info_free_entry(snd_card_module_info_entry); 880 - #endif 881 - return 0; 882 - } 883 - 884 877 #endif /* CONFIG_PROC_FS */ 885 878 886 879 /**
-10
sound/core/sound.c
··· 334 334 /* 335 335 * INFO PART 336 336 */ 337 - 338 - static struct snd_info_entry *snd_minor_info_entry; 339 - 340 337 static const char *snd_device_type_name(int type) 341 338 { 342 339 switch (type) { ··· 393 396 entry = NULL; 394 397 } 395 398 } 396 - snd_minor_info_entry = entry; 397 - return 0; 398 - } 399 - 400 - int __exit snd_minor_info_done(void) 401 - { 402 - snd_info_free_entry(snd_minor_info_entry); 403 399 return 0; 404 400 } 405 401 #endif /* CONFIG_PROC_FS */
+1 -13
sound/core/sound_oss.c
··· 214 214 */ 215 215 216 216 #ifdef CONFIG_PROC_FS 217 - 218 - static struct snd_info_entry *snd_minor_info_oss_entry; 219 - 220 217 static const char *snd_oss_device_type_name(int type) 221 218 { 222 219 switch (type) { ··· 262 265 entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root); 263 266 if (entry) { 264 267 entry->c.text.read = snd_minor_info_oss_read; 265 - if (snd_info_register(entry) < 0) { 268 + if (snd_info_register(entry) < 0) 266 269 snd_info_free_entry(entry); 267 - entry = NULL; 268 - } 269 270 } 270 - snd_minor_info_oss_entry = entry; 271 - return 0; 272 - } 273 - 274 - int __exit snd_minor_info_oss_done(void) 275 - { 276 - snd_info_free_entry(snd_minor_info_oss_entry); 277 271 return 0; 278 272 } 279 273 #endif /* CONFIG_PROC_FS */