diff options
author | Takashi Iwai <tiwai@suse.de> | 2010-08-05 11:17:04 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2010-08-05 11:17:04 +0200 |
commit | 74bf40f0793fed9e01eb6164c2ce63e8c27ca205 (patch) | |
tree | f41312c0943978842ac258873b29da04d72d0625 /sound/oss/sh_dac_audio.c | |
parent | e71981343ad29b5d929f82ac56c0b27b8ea0e540 (diff) | |
parent | c4685849b4d725ab80cd29f5e09f5f128b4724b5 (diff) |
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/oss/sh_dac_audio.c')
-rw-r--r-- | sound/oss/sh_dac_audio.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/sound/oss/sh_dac_audio.c b/sound/oss/sh_dac_audio.c index 4153752507e..fdb58eb83d4 100644 --- a/sound/oss/sh_dac_audio.c +++ b/sound/oss/sh_dac_audio.c @@ -15,7 +15,9 @@ #include <linux/linkage.h> #include <linux/slab.h> #include <linux/fs.h> +#include <linux/smp_lock.h> #include <linux/sound.h> +#include <linux/smp_lock.h> #include <linux/soundcard.h> #include <linux/interrupt.h> #include <linux/hrtimer.h> @@ -92,7 +94,7 @@ static void dac_audio_set_rate(void) wakeups_per_second = ktime_set(0, 1000000000 / rate); } -static int dac_audio_ioctl(struct inode *inode, struct file *file, +static int dac_audio_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { int val; @@ -158,6 +160,17 @@ static int dac_audio_ioctl(struct inode *inode, struct file *file, return -EINVAL; } +static long dac_audio_unlocked_ioctl(struct file *file, u_int cmd, u_long arg) +{ + int ret; + + lock_kernel(); + ret = dac_audio_ioctl(file, cmd, arg); + unlock_kernel(); + + return ret; +} + static ssize_t dac_audio_write(struct file *file, const char *buf, size_t count, loff_t * ppos) { @@ -216,13 +229,17 @@ static int dac_audio_open(struct inode *inode, struct file *file) { if (file->f_mode & FMODE_READ) return -ENODEV; - if (in_use) + + lock_kernel(); + if (in_use) { + unlock_kernel(); return -EBUSY; + } in_use = 1; dac_audio_start(); - + unlock_kernel(); return 0; } @@ -237,8 +254,8 @@ static int dac_audio_release(struct inode *inode, struct file *file) const struct file_operations dac_audio_fops = { .read = dac_audio_read, - .write = dac_audio_write, - .ioctl = dac_audio_ioctl, + .write = dac_audio_write, + .unlocked_ioctl = dac_audio_unlocked_ioctl, .open = dac_audio_open, .release = dac_audio_release, }; |