summaryrefslogtreecommitdiffstats
path: root/sound/core/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core/info.c')
-rw-r--r--sound/core/info.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/sound/core/info.c b/sound/core/info.c
index af123e3..2582b74 100644
--- a/sound/core/info.c
+++ b/sound/core/info.c
@@ -31,6 +31,7 @@
#include <sound/version.h>
#include <linux/proc_fs.h>
#include <linux/devfs_fs_kernel.h>
+#include <linux/mutex.h>
#include <stdarg.h>
/*
@@ -68,7 +69,7 @@ int snd_info_check_reserved_words(const char *str)
return 1;
}
-static DECLARE_MUTEX(info_mutex);
+static DEFINE_MUTEX(info_mutex);
struct snd_info_private_data {
struct snd_info_buffer *rbuffer;
@@ -265,11 +266,11 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
struct proc_dir_entry *p;
int mode, err;
- down(&info_mutex);
+ mutex_lock(&info_mutex);
p = PDE(inode);
entry = p == NULL ? NULL : (struct snd_info_entry *)p->data;
if (entry == NULL || entry->disconnected) {
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
return -ENODEV;
}
if (!try_module_get(entry->module)) {
@@ -361,13 +362,13 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
break;
}
file->private_data = data;
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
if (entry->content == SNDRV_INFO_CONTENT_TEXT &&
(mode == O_RDONLY || mode == O_RDWR)) {
if (entry->c.text.read) {
- down(&entry->access);
+ mutex_lock(&entry->access);
entry->c.text.read(entry, data->rbuffer);
- up(&entry->access);
+ mutex_unlock(&entry->access);
}
}
return 0;
@@ -375,7 +376,7 @@ static int snd_info_entry_open(struct inode *inode, struct file *file)
__error:
module_put(entry->module);
__error1:
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
return err;
}
@@ -747,7 +748,7 @@ static struct snd_info_entry *snd_info_create_entry(const char *name)
}
entry->mode = S_IFREG | S_IRUGO;
entry->content = SNDRV_INFO_CONTENT_TEXT;
- init_MUTEX(&entry->access);
+ mutex_init(&entry->access);
return entry;
}
@@ -896,10 +897,10 @@ int snd_info_register(struct snd_info_entry * entry)
snd_assert(entry != NULL, return -ENXIO);
root = entry->parent == NULL ? snd_proc_root : entry->parent->p;
- down(&info_mutex);
+ mutex_lock(&info_mutex);
p = snd_create_proc_entry(entry->name, entry->mode, root);
if (!p) {
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
return -ENOMEM;
}
p->owner = entry->module;
@@ -908,7 +909,7 @@ int snd_info_register(struct snd_info_entry * entry)
p->size = entry->size;
p->data = entry;
entry->p = p;
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
return 0;
}
@@ -929,9 +930,9 @@ int snd_info_unregister(struct snd_info_entry * entry)
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);
+ mutex_lock(&info_mutex);
snd_remove_proc_entry(root, entry->p);
- up(&info_mutex);
+ mutex_unlock(&info_mutex);
snd_info_free_entry(entry);
return 0;
}
OpenPOWER on IntegriCloud