]> err.no Git - linux-2.6/blobdiff - sound/core/info.c
Merge with http://kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
[linux-2.6] / sound / core / info.c
index 31faffe01cb0fde0a4c73834cb69ad2c464954dc..39f9b97d92198582fbb34a6281d864b6443d90e8 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/vmalloc.h>
 #include <linux/time.h>
 #include <linux/smp_lock.h>
+#include <linux/string.h>
 #include <sound/core.h>
 #include <sound/minors.h>
 #include <sound/info.h>
@@ -294,7 +295,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
                        goto __error;
                }
        }
-       data = kcalloc(1, sizeof(*data), GFP_KERNEL);
+       data = kzalloc(sizeof(*data), GFP_KERNEL);
        if (data == NULL) {
                err = -ENOMEM;
                goto __error;
@@ -303,7 +304,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
        switch (entry->content) {
        case SNDRV_INFO_CONTENT_TEXT:
                if (mode == O_RDONLY || mode == O_RDWR) {
-                       buffer = kcalloc(1, sizeof(*buffer), GFP_KERNEL);
+                       buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
                        if (buffer == NULL) {
                                kfree(data);
                                err = -ENOMEM;
@@ -322,7 +323,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
                        data->rbuffer = buffer;
                }
                if (mode == O_WRONLY || mode == O_RDWR) {
-                       buffer = kcalloc(1, sizeof(*buffer), GFP_KERNEL);
+                       buffer = kzalloc(sizeof(*buffer), GFP_KERNEL);
                        if (buffer == NULL) {
                                if (mode == O_RDWR) {
                                        vfree(data->rbuffer->buffer);
@@ -565,7 +566,6 @@ int __init snd_info_init(void)
        }
 #endif
        snd_info_version_init();
-       snd_memory_info_init();
        snd_minor_info_init();
        snd_minor_info_oss_init();
        snd_card_info_init();
@@ -577,7 +577,6 @@ int __exit snd_info_done(void)
        snd_card_info_done();
        snd_minor_info_oss_done();
        snd_minor_info_done();
-       snd_memory_info_done();
        snd_info_version_done();
        if (snd_proc_root) {
 #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
@@ -701,7 +700,7 @@ int snd_info_get_line(snd_info_buffer_t * buffer, char *line, int len)
 }
 
 /**
- * snd_info_get_line - parse a string token
+ * snd_info_get_str - parse a string token
  * @dest: the buffer to store the string token
  * @src: the original string
  * @len: the max. length of token - 1
@@ -751,10 +750,10 @@ char *snd_info_get_str(char *dest, char *src, int len)
 static snd_info_entry_t *snd_info_create_entry(const char *name)
 {
        snd_info_entry_t *entry;
-       entry = kcalloc(1, sizeof(*entry), GFP_KERNEL);
+       entry = kzalloc(sizeof(*entry), GFP_KERNEL);
        if (entry == NULL)
                return NULL;
-       entry->name = snd_kmalloc_strdup(name, GFP_KERNEL);
+       entry->name = kstrdup(name, GFP_KERNEL);
        if (entry->name == NULL) {
                kfree(entry);
                return NULL;
@@ -938,7 +937,8 @@ int snd_info_unregister(snd_info_entry_t * entry)
 {
        struct proc_dir_entry *root;
 
-       snd_assert(entry != NULL && entry->p != NULL, return -ENXIO);
+       snd_assert(entry != NULL, return -ENXIO);
+       snd_assert(entry->p != NULL, return -ENXIO);
        root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
        snd_assert(root, return -ENXIO);
        down(&info_mutex);