ALSA: core: Remove superfluous exit calls for proc entries
authorTakashi Iwai <tiwai@suse.de>
Wed, 22 Apr 2015 19:33:41 +0000 (21:33 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 24 Apr 2015 15:31:04 +0000 (17:31 +0200)
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>
include/sound/core.h
sound/core/info.c
sound/core/init.c
sound/core/sound.c
sound/core/sound_oss.c

index b12931f513f4a89539e30ab825816571819e64bd..cdfecafff0f49092331e422a7ab82ec23f781c99 100644 (file)
@@ -224,16 +224,13 @@ void *snd_lookup_oss_minor_data(unsigned int minor, int type);
 #endif
 
 int snd_minor_info_init(void);
-int snd_minor_info_done(void);
 
 /* sound_oss.c */
 
 #ifdef CONFIG_SND_OSSEMUL
 int snd_minor_info_oss_init(void);
-int snd_minor_info_oss_done(void);
 #else
 static inline int snd_minor_info_oss_init(void) { return 0; }
-static inline int snd_minor_info_oss_done(void) { return 0; }
 #endif
 
 /* memory.c */
@@ -262,7 +259,6 @@ int snd_card_free_when_closed(struct snd_card *card);
 void snd_card_set_id(struct snd_card *card, const char *id);
 int snd_card_register(struct snd_card *card);
 int snd_card_info_init(void);
-int snd_card_info_done(void);
 int snd_card_add_dev_attr(struct snd_card *card,
                          const struct attribute_group *group);
 int snd_component_add(struct snd_card *card, const char *component);
index 55c626eeb06191ca2d58ec9d57c21e39487d028e..339f90a3aa29bb9a089b3ecff01d9049bb06d6e1 100644 (file)
@@ -495,9 +495,6 @@ int __init snd_info_init(void)
 
 int __exit snd_info_done(void)
 {
-       snd_card_info_done();
-       snd_minor_info_oss_done();
-       snd_minor_info_done();
        snd_info_free_entry(snd_proc_root);
        return 0;
 }
index 04734e047bfe47e9bba67ace601b75db438608ed..0af34fac04990a59bab53ccc670a1756ce79406e 100644 (file)
@@ -783,8 +783,6 @@ int snd_card_register(struct snd_card *card)
 EXPORT_SYMBOL(snd_card_register);
 
 #ifdef CONFIG_PROC_FS
-static struct snd_info_entry *snd_card_info_entry;
-
 static void snd_card_info_read(struct snd_info_entry *entry,
                               struct snd_info_buffer *buffer)
 {
@@ -810,7 +808,6 @@ static void snd_card_info_read(struct snd_info_entry *entry,
 }
 
 #ifdef CONFIG_SND_OSSEMUL
-
 void snd_card_info_read_oss(struct snd_info_buffer *buffer)
 {
        int idx, count;
@@ -832,7 +829,6 @@ void snd_card_info_read_oss(struct snd_info_buffer *buffer)
 #endif
 
 #ifdef MODULE
-static struct snd_info_entry *snd_card_module_info_entry;
 static void snd_card_module_info_read(struct snd_info_entry *entry,
                                      struct snd_info_buffer *buffer)
 {
@@ -861,7 +857,6 @@ int __init snd_card_info_init(void)
                snd_info_free_entry(entry);
                return -ENOMEM;
        }
-       snd_card_info_entry = entry;
 
 #ifdef MODULE
        entry = snd_info_create_module_entry(THIS_MODULE, "modules", NULL);
@@ -869,23 +864,11 @@ int __init snd_card_info_init(void)
                entry->c.text.read = snd_card_module_info_read;
                if (snd_info_register(entry) < 0)
                        snd_info_free_entry(entry);
-               else
-                       snd_card_module_info_entry = entry;
        }
 #endif
 
        return 0;
 }
-
-int __exit snd_card_info_done(void)
-{
-       snd_info_free_entry(snd_card_info_entry);
-#ifdef MODULE
-       snd_info_free_entry(snd_card_module_info_entry);
-#endif
-       return 0;
-}
-
 #endif /* CONFIG_PROC_FS */
 
 /**
index 5fc93d00572a5fc4f9ecfa3ba070aa2b3b8efb6f..d584944c8fe55d37459cfed5ff53582d3fe0d657 100644 (file)
@@ -334,9 +334,6 @@ EXPORT_SYMBOL(snd_unregister_device);
 /*
  *  INFO PART
  */
-
-static struct snd_info_entry *snd_minor_info_entry;
-
 static const char *snd_device_type_name(int type)
 {
        switch (type) {
@@ -396,13 +393,6 @@ int __init snd_minor_info_init(void)
                        entry = NULL;
                }
        }
-       snd_minor_info_entry = entry;
-       return 0;
-}
-
-int __exit snd_minor_info_done(void)
-{
-       snd_info_free_entry(snd_minor_info_entry);
        return 0;
 }
 #endif /* CONFIG_PROC_FS */
index 573a65eb2b796961ed72b2999dc4b63fb05326ef..5fc3c6534225dc122803b594e6d8cd81ace2e9db 100644 (file)
@@ -214,9 +214,6 @@ EXPORT_SYMBOL(snd_unregister_oss_device);
  */
 
 #ifdef CONFIG_PROC_FS
-
-static struct snd_info_entry *snd_minor_info_oss_entry;
-
 static const char *snd_oss_device_type_name(int type)
 {
        switch (type) {
@@ -265,18 +262,9 @@ int __init snd_minor_info_oss_init(void)
        entry = snd_info_create_module_entry(THIS_MODULE, "devices", snd_oss_root);
        if (entry) {
                entry->c.text.read = snd_minor_info_oss_read;
-               if (snd_info_register(entry) < 0) {
+               if (snd_info_register(entry) < 0)
                        snd_info_free_entry(entry);
-                       entry = NULL;
-               }
        }
-       snd_minor_info_oss_entry = entry;
-       return 0;
-}
-
-int __exit snd_minor_info_oss_done(void)
-{
-       snd_info_free_entry(snd_minor_info_oss_entry);
        return 0;
 }
 #endif /* CONFIG_PROC_FS */