#include <linux/init.h>
#include <linux/smp_lock.h>
#include <linux/moduleparam.h>
+#include <linux/mutex.h>
#include <sound/core.h>
#include <sound/minors.h>
#include <sound/initval.h>
* ALSA minor device interface
*/
-static DECLARE_MUTEX(register_mutex);
+static DEFINE_MUTEX(register_mutex);
static int
odev_open(struct inode *inode, struct file *file)
else
level = SNDRV_SEQ_OSS_MODE_SYNTH;
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
rc = snd_seq_oss_open(file, level);
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return rc;
}
snd_seq_oss_drain_write(dp);
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
snd_seq_oss_release(dp);
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return 0;
}
{
int rc;
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER,
NULL, 0,
&seq_oss_f_ops, NULL,
SNDRV_SEQ_OSS_DEVNAME)) < 0) {
snd_printk(KERN_ERR "can't register device seq\n");
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return rc;
}
if ((rc = snd_register_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC,
SNDRV_SEQ_OSS_DEVNAME)) < 0) {
snd_printk(KERN_ERR "can't register device music\n");
snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0);
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return rc;
}
debug_printk(("device registered\n"));
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
return 0;
}
static void
unregister_device(void)
{
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
debug_printk(("device unregistered\n"));
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_MUSIC, NULL, 0) < 0)
snd_printk(KERN_ERR "error unregister device music\n");
if (snd_unregister_oss_device(SNDRV_OSS_DEVICE_TYPE_SEQUENCER, NULL, 0) < 0)
snd_printk(KERN_ERR "error unregister device seq\n");
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
}
/*
static void
info_read(struct snd_info_entry *entry, struct snd_info_buffer *buf)
{
- down(®ister_mutex);
+ mutex_lock(®ister_mutex);
snd_iprintf(buf, "OSS sequencer emulation version %s\n", SNDRV_SEQ_OSS_VERSION_STR);
snd_seq_oss_system_info_read(buf);
snd_seq_oss_synth_info_read(buf);
snd_seq_oss_midi_info_read(buf);
- up(®ister_mutex);
+ mutex_unlock(®ister_mutex);
}
entry->content = SNDRV_INFO_CONTENT_TEXT;
entry->private_data = NULL;
- entry->c.text.read_size = 1024;
entry->c.text.read = info_read;
if (snd_info_register(entry) < 0) {
snd_info_free_entry(entry);
static void
unregister_proc(void)
{
- if (info_entry)
- snd_info_unregister(info_entry);
+ snd_info_free_entry(info_entry);
info_entry = NULL;
}
#endif /* CONFIG_PROC_FS */