[ALSA] Unregister device files at disconnection
[pandora-kernel.git] / sound / core / sound.c
index 264f2ef..b4430db 100644 (file)
@@ -244,7 +244,7 @@ int snd_register_device(int type, struct snd_card *card, int dev,
        struct device *device = NULL;
 
        snd_assert(name, return -EINVAL);
-       preg = kmalloc(sizeof(struct snd_minor) + strlen(name) + 1, GFP_KERNEL);
+       preg = kmalloc(sizeof *preg, GFP_KERNEL);
        if (preg == NULL)
                return -ENOMEM;
        preg->type = type;
@@ -252,7 +252,6 @@ int snd_register_device(int type, struct snd_card *card, int dev,
        preg->device = dev;
        preg->f_ops = f_ops;
        preg->private_data = private_data;
-       strcpy(preg->name, name);
        mutex_lock(&sound_mutex);
 #ifdef CONFIG_SND_DYNAMIC_MINORS
        minor = snd_find_free_minor();
@@ -388,8 +387,7 @@ int __init snd_minor_info_init(void)
 
 int __exit snd_minor_info_done(void)
 {
-       if (snd_minor_info_entry)
-               snd_info_unregister(snd_minor_info_entry);
+       snd_info_free_entry(snd_minor_info_entry);
        return 0;
 }
 #endif /* CONFIG_PROC_FS */