]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/core/init.c
[ALSA] Fix disconnection of proc interface
[mirror_ubuntu-bionic-kernel.git] / sound / core / init.c
index 38b2d4a9d672f6055d4183b84be8b27c06df060c..1ecb029ff4c91b9e8bfda319ae45dbc78ec3f8e5 100644 (file)
@@ -38,8 +38,8 @@ struct snd_shutdown_f_ops {
        struct snd_shutdown_f_ops *next;
 };
 
-static unsigned int snd_cards_lock = 0;        /* locked for registering/using */
-struct snd_card *snd_cards[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = NULL};
+static unsigned int snd_cards_lock;    /* locked for registering/using */
+struct snd_card *snd_cards[SNDRV_CARDS];
 EXPORT_SYMBOL(snd_cards);
 
 static DEFINE_MUTEX(snd_card_mutex);
@@ -310,6 +310,7 @@ int snd_card_disconnect(struct snd_card *card)
        if (err < 0)
                snd_printk(KERN_ERR "not all devices for card %i can be disconnected\n", card->number);
 
+       snd_info_card_disconnect(card);
        return 0;       
 }
 
@@ -360,7 +361,7 @@ int snd_card_free(struct snd_card *card)
        }
        if (card->private_free)
                card->private_free(card);
-       snd_info_unregister(card->proc_id);
+       snd_info_free_entry(card->proc_id);
        if (snd_info_card_free(card) < 0) {
                snd_printk(KERN_WARNING "unable to free card info\n");
                /* Not fatal error */
@@ -529,7 +530,7 @@ 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 = NULL;
+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)
@@ -625,9 +626,9 @@ int __init snd_card_info_init(void)
 
 int __exit snd_card_info_done(void)
 {
-       snd_info_unregister(snd_card_info_entry);
+       snd_info_free_entry(snd_card_info_entry);
 #ifdef MODULE
-       snd_info_unregister(snd_card_module_info_entry);
+       snd_info_free_entry(snd_card_module_info_entry);
 #endif
        return 0;
 }