|
@@ -8,7 +8,7 @@
|
|
#include "linux/slab.h"
|
|
#include "linux/slab.h"
|
|
#include "linux/sound.h"
|
|
#include "linux/sound.h"
|
|
#include "linux/soundcard.h"
|
|
#include "linux/soundcard.h"
|
|
-#include "linux/smp_lock.h"
|
|
|
|
|
|
+#include "linux/mutex.h"
|
|
#include "asm/uaccess.h"
|
|
#include "asm/uaccess.h"
|
|
#include "init.h"
|
|
#include "init.h"
|
|
#include "os.h"
|
|
#include "os.h"
|
|
@@ -67,6 +67,8 @@ MODULE_PARM_DESC(mixer, MIXER_HELP);
|
|
|
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
+static DEFINE_MUTEX(hostaudio_mutex);
|
|
|
|
+
|
|
/* /dev/dsp file operations */
|
|
/* /dev/dsp file operations */
|
|
|
|
|
|
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
|
|
static ssize_t hostaudio_read(struct file *file, char __user *buffer,
|
|
@@ -202,9 +204,9 @@ static int hostaudio_open(struct inode *inode, struct file *file)
|
|
w = 1;
|
|
w = 1;
|
|
|
|
|
|
kparam_block_sysfs_write(dsp);
|
|
kparam_block_sysfs_write(dsp);
|
|
- lock_kernel();
|
|
|
|
|
|
+ mutex_lock(&hostaudio_mutex);
|
|
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
|
|
ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0);
|
|
- unlock_kernel();
|
|
|
|
|
|
+ mutex_unlock(&hostaudio_mutex);
|
|
kparam_unblock_sysfs_write(dsp);
|
|
kparam_unblock_sysfs_write(dsp);
|
|
|
|
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|
|
@@ -263,9 +265,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file)
|
|
w = 1;
|
|
w = 1;
|
|
|
|
|
|
kparam_block_sysfs_write(mixer);
|
|
kparam_block_sysfs_write(mixer);
|
|
- lock_kernel();
|
|
|
|
|
|
+ mutex_lock(&hostaudio_mutex);
|
|
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
|
|
ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0);
|
|
- unlock_kernel();
|
|
|
|
|
|
+ mutex_unlock(&hostaudio_mutex);
|
|
kparam_unblock_sysfs_write(mixer);
|
|
kparam_unblock_sysfs_write(mixer);
|
|
|
|
|
|
if (ret < 0) {
|
|
if (ret < 0) {
|