X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=arch%2Fum%2Fdrivers%2Fhostaudio_kern.c;h=f9f6a4e205901ee603d56d0167fb3c6e0807e868;hb=2290c0d06d82faee87b1ab2d9d4f7bf81ef64379;hp=63c740a85b4cca0ed9333091593885cbdfface2e;hpb=aa5c14d5c0d3e4c587db4a1b220b9c86415c538f;p=~andy%2Flinux diff --git a/arch/um/drivers/hostaudio_kern.c b/arch/um/drivers/hostaudio_kern.c index 63c740a85b4..f9f6a4e2059 100644 --- a/arch/um/drivers/hostaudio_kern.c +++ b/arch/um/drivers/hostaudio_kern.c @@ -8,7 +8,7 @@ #include "linux/slab.h" #include "linux/sound.h" #include "linux/soundcard.h" -#include "linux/smp_lock.h" +#include "linux/mutex.h" #include "asm/uaccess.h" #include "init.h" #include "os.h" @@ -63,6 +63,8 @@ static int set_mixer(char *name, int *add) __uml_setup("mixer=", set_mixer, "mixer=\n" MIXER_HELP); #endif +static DEFINE_MUTEX(hostaudio_mutex); + /* /dev/dsp file operations */ static ssize_t hostaudio_read(struct file *file, char __user *buffer, @@ -198,9 +200,9 @@ static int hostaudio_open(struct inode *inode, struct file *file) w = 1; kparam_block_sysfs_write(dsp); - lock_kernel(); + mutex_lock(&hostaudio_mutex); ret = os_open_file(dsp, of_set_rw(OPENFLAGS(), r, w), 0); - unlock_kernel(); + mutex_unlock(&hostaudio_mutex); kparam_unblock_sysfs_write(dsp); if (ret < 0) { @@ -259,9 +261,9 @@ static int hostmixer_open_mixdev(struct inode *inode, struct file *file) w = 1; kparam_block_sysfs_write(mixer); - lock_kernel(); + mutex_lock(&hostaudio_mutex); ret = os_open_file(mixer, of_set_rw(OPENFLAGS(), r, w), 0); - unlock_kernel(); + mutex_unlock(&hostaudio_mutex); kparam_unblock_sysfs_write(mixer); if (ret < 0) {