sound/oss: convert to unlocked_ioctl
These are the final conversions for the ioctl file operation so we can remove it in the next merge window. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
committed by
Takashi Iwai
parent
90dc763fef
commit
d209974cdc
@@ -827,22 +827,26 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
|
|||||||
return codec->mixer_ioctl(codec, cmd, arg);
|
return codec->mixer_ioctl(codec, cmd, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static long
|
||||||
au1550_ioctl_mixdev(struct inode *inode, struct file *file,
|
au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
unsigned int cmd, unsigned long arg)
|
|
||||||
{
|
{
|
||||||
struct au1550_state *s = (struct au1550_state *)file->private_data;
|
struct au1550_state *s = (struct au1550_state *)file->private_data;
|
||||||
struct ac97_codec *codec = s->codec;
|
struct ac97_codec *codec = s->codec;
|
||||||
|
int ret;
|
||||||
|
|
||||||
return mixdev_ioctl(codec, cmd, arg);
|
lock_kernel();
|
||||||
|
ret = mixdev_ioctl(codec, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static /*const */ struct file_operations au1550_mixer_fops = {
|
static /*const */ struct file_operations au1550_mixer_fops = {
|
||||||
owner:THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
llseek:au1550_llseek,
|
.llseek = au1550_llseek,
|
||||||
ioctl:au1550_ioctl_mixdev,
|
.unlocked_ioctl = au1550_ioctl_mixdev,
|
||||||
open:au1550_open_mixdev,
|
.open = au1550_open_mixdev,
|
||||||
release:au1550_release_mixdev,
|
.release = au1550_release_mixdev,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -1346,8 +1350,7 @@ dma_count_done(struct dmabuf *db)
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
|
au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
unsigned long arg)
|
|
||||||
{
|
{
|
||||||
struct au1550_state *s = (struct au1550_state *)file->private_data;
|
struct au1550_state *s = (struct au1550_state *)file->private_data;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
@@ -1783,6 +1786,17 @@ au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
|
|||||||
return mixdev_ioctl(s->codec, cmd, arg);
|
return mixdev_ioctl(s->codec, cmd, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long
|
||||||
|
au1550_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = au1550_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
au1550_open(struct inode *inode, struct file *file)
|
au1550_open(struct inode *inode, struct file *file)
|
||||||
@@ -1893,15 +1907,15 @@ au1550_release(struct inode *inode, struct file *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static /*const */ struct file_operations au1550_audio_fops = {
|
static /*const */ struct file_operations au1550_audio_fops = {
|
||||||
owner: THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
llseek: au1550_llseek,
|
.llseek = au1550_llseek,
|
||||||
read: au1550_read,
|
.read = au1550_read,
|
||||||
write: au1550_write,
|
.write = au1550_write,
|
||||||
poll: au1550_poll,
|
.poll = au1550_poll,
|
||||||
ioctl: au1550_ioctl,
|
.unlocked_ioctl = au1550_unlocked_ioctl,
|
||||||
mmap: au1550_mmap,
|
.mmap = au1550_mmap,
|
||||||
open: au1550_open,
|
.open = au1550_open,
|
||||||
release: au1550_release,
|
.release = au1550_release,
|
||||||
};
|
};
|
||||||
|
|
||||||
MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
|
MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
|
||||||
|
@@ -341,8 +341,8 @@ static int mixer_release(struct inode *inode, struct file *file)
|
|||||||
unlock_kernel();
|
unlock_kernel();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
|
||||||
u_long arg)
|
static int mixer_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||||
{
|
{
|
||||||
if (_SIOC_DIR(cmd) & _SIOC_WRITE)
|
if (_SIOC_DIR(cmd) & _SIOC_WRITE)
|
||||||
mixer.modify_counter++;
|
mixer.modify_counter++;
|
||||||
@@ -366,11 +366,22 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long mixer_unlocked_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = mixer_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct file_operations mixer_fops =
|
static const struct file_operations mixer_fops =
|
||||||
{
|
{
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.llseek = no_llseek,
|
.llseek = no_llseek,
|
||||||
.ioctl = mixer_ioctl,
|
.unlocked_ioctl = mixer_unlocked_ioctl,
|
||||||
.open = mixer_open,
|
.open = mixer_open,
|
||||||
.release = mixer_release,
|
.release = mixer_release,
|
||||||
};
|
};
|
||||||
@@ -963,8 +974,7 @@ printk("dmasound_core: tried to set_queue_frags on a locked queue\n") ;
|
|||||||
return 0 ;
|
return 0 ;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
static int sq_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||||
u_long arg)
|
|
||||||
{
|
{
|
||||||
int val, result;
|
int val, result;
|
||||||
u_long fmt;
|
u_long fmt;
|
||||||
@@ -1122,18 +1132,29 @@ static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
|
|||||||
return IOCTL_OUT(arg,val);
|
return IOCTL_OUT(arg,val);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return mixer_ioctl(inode, file, cmd, arg);
|
return mixer_ioctl(file, cmd, arg);
|
||||||
}
|
}
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long sq_unlocked_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = sq_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct file_operations sq_fops =
|
static const struct file_operations sq_fops =
|
||||||
{
|
{
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.llseek = no_llseek,
|
.llseek = no_llseek,
|
||||||
.write = sq_write,
|
.write = sq_write,
|
||||||
.poll = sq_poll,
|
.poll = sq_poll,
|
||||||
.ioctl = sq_ioctl,
|
.unlocked_ioctl = sq_unlocked_ioctl,
|
||||||
.open = sq_open,
|
.open = sq_open,
|
||||||
.release = sq_release,
|
.release = sq_release,
|
||||||
};
|
};
|
||||||
|
@@ -639,21 +639,26 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
|
static long dev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int minor = iminor(inode);
|
int minor = iminor(inode);
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (cmd == OSS_GETVERSION) {
|
if (cmd == OSS_GETVERSION) {
|
||||||
int sound_version = SOUND_VERSION;
|
int sound_version = SOUND_VERSION;
|
||||||
return put_user(sound_version, (int __user *)arg);
|
return put_user(sound_version, (int __user *)arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minor == dev.dsp_minor)
|
ret = -EINVAL;
|
||||||
return dsp_ioctl(file, cmd, arg);
|
|
||||||
else if (minor == dev.mixer_minor)
|
|
||||||
return mixer_ioctl(cmd, arg);
|
|
||||||
|
|
||||||
return -EINVAL;
|
lock_kernel();
|
||||||
|
if (minor == dev.dsp_minor)
|
||||||
|
ret = dsp_ioctl(file, cmd, arg);
|
||||||
|
else if (minor == dev.mixer_minor)
|
||||||
|
ret = mixer_ioctl(cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dsp_write_flush(void)
|
static void dsp_write_flush(void)
|
||||||
@@ -1109,7 +1114,7 @@ static const struct file_operations dev_fileops = {
|
|||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.read = dev_read,
|
.read = dev_read,
|
||||||
.write = dev_write,
|
.write = dev_write,
|
||||||
.ioctl = dev_ioctl,
|
.unlocked_ioctl = dev_ioctl,
|
||||||
.open = dev_open,
|
.open = dev_open,
|
||||||
.release = dev_release,
|
.release = dev_release,
|
||||||
};
|
};
|
||||||
|
@@ -15,6 +15,7 @@
|
|||||||
#include <linux/linkage.h>
|
#include <linux/linkage.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/sound.h>
|
#include <linux/sound.h>
|
||||||
#include <linux/smp_lock.h>
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/soundcard.h>
|
#include <linux/soundcard.h>
|
||||||
@@ -93,7 +94,7 @@ static void dac_audio_set_rate(void)
|
|||||||
wakeups_per_second = ktime_set(0, 1000000000 / rate);
|
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)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
int val;
|
int val;
|
||||||
@@ -159,6 +160,17 @@ static int dac_audio_ioctl(struct inode *inode, struct file *file,
|
|||||||
return -EINVAL;
|
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,
|
static ssize_t dac_audio_write(struct file *file, const char *buf, size_t count,
|
||||||
loff_t * ppos)
|
loff_t * ppos)
|
||||||
{
|
{
|
||||||
@@ -242,8 +254,8 @@ static int dac_audio_release(struct inode *inode, struct file *file)
|
|||||||
|
|
||||||
const struct file_operations dac_audio_fops = {
|
const struct file_operations dac_audio_fops = {
|
||||||
.read = dac_audio_read,
|
.read = dac_audio_read,
|
||||||
.write = dac_audio_write,
|
.write = dac_audio_write,
|
||||||
.ioctl = dac_audio_ioctl,
|
.unlocked_ioctl = dac_audio_unlocked_ioctl,
|
||||||
.open = dac_audio_open,
|
.open = dac_audio_open,
|
||||||
.release = dac_audio_release,
|
.release = dac_audio_release,
|
||||||
};
|
};
|
||||||
|
@@ -1571,11 +1571,15 @@ static int cs4297a_release_mixdev(struct inode *inode, struct file *file)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file,
|
static int cs4297a_ioctl_mixdev(struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
return mixer_ioctl((struct cs4297a_state *) file->private_data, cmd,
|
int ret;
|
||||||
|
lock_kernel();
|
||||||
|
ret = mixer_ioctl((struct cs4297a_state *) file->private_data, cmd,
|
||||||
arg);
|
arg);
|
||||||
|
unlock_kernel();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1585,7 +1589,7 @@ static int cs4297a_ioctl_mixdev(struct inode *inode, struct file *file,
|
|||||||
static const struct file_operations cs4297a_mixer_fops = {
|
static const struct file_operations cs4297a_mixer_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.llseek = no_llseek,
|
.llseek = no_llseek,
|
||||||
.ioctl = cs4297a_ioctl_mixdev,
|
.unlocked_ioctl = cs4297a_ioctl_mixdev,
|
||||||
.open = cs4297a_open_mixdev,
|
.open = cs4297a_open_mixdev,
|
||||||
.release = cs4297a_release_mixdev,
|
.release = cs4297a_release_mixdev,
|
||||||
};
|
};
|
||||||
@@ -1949,7 +1953,7 @@ static int cs4297a_mmap(struct file *file, struct vm_area_struct *vma)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int cs4297a_ioctl(struct inode *inode, struct file *file,
|
static int cs4297a_ioctl(struct file *file,
|
||||||
unsigned int cmd, unsigned long arg)
|
unsigned int cmd, unsigned long arg)
|
||||||
{
|
{
|
||||||
struct cs4297a_state *s =
|
struct cs4297a_state *s =
|
||||||
@@ -2342,6 +2346,16 @@ static int cs4297a_ioctl(struct inode *inode, struct file *file,
|
|||||||
return mixer_ioctl(s, cmd, arg);
|
return mixer_ioctl(s, cmd, arg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static long cs4297a_unlocked_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
|
ret = cs4297a_ioctl(file, cmd, arg);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
static int cs4297a_release(struct inode *inode, struct file *file)
|
static int cs4297a_release(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
@@ -2511,7 +2525,7 @@ static const struct file_operations cs4297a_audio_fops = {
|
|||||||
.read = cs4297a_read,
|
.read = cs4297a_read,
|
||||||
.write = cs4297a_write,
|
.write = cs4297a_write,
|
||||||
.poll = cs4297a_poll,
|
.poll = cs4297a_poll,
|
||||||
.ioctl = cs4297a_ioctl,
|
.unlocked_ioctl = cs4297a_unlocked_ioctl,
|
||||||
.mmap = cs4297a_mmap,
|
.mmap = cs4297a_mmap,
|
||||||
.open = cs4297a_open,
|
.open = cs4297a_open,
|
||||||
.release = cs4297a_release,
|
.release = cs4297a_release,
|
||||||
|
@@ -2429,8 +2429,7 @@ static unsigned int vwsnd_audio_poll(struct file *file,
|
|||||||
return mask;
|
return mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vwsnd_audio_do_ioctl(struct inode *inode,
|
static int vwsnd_audio_do_ioctl(struct file *file,
|
||||||
struct file *file,
|
|
||||||
unsigned int cmd,
|
unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
@@ -2446,8 +2445,8 @@ static int vwsnd_audio_do_ioctl(struct inode *inode,
|
|||||||
int ival;
|
int ival;
|
||||||
|
|
||||||
|
|
||||||
DBGEV("(inode=0x%p, file=0x%p, cmd=0x%x, arg=0x%lx)\n",
|
DBGEV("(file=0x%p, cmd=0x%x, arg=0x%lx)\n",
|
||||||
inode, file, cmd, arg);
|
file, cmd, arg);
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case OSS_GETVERSION: /* _SIOR ('M', 118, int) */
|
case OSS_GETVERSION: /* _SIOR ('M', 118, int) */
|
||||||
DBGX("OSS_GETVERSION\n");
|
DBGX("OSS_GETVERSION\n");
|
||||||
@@ -2885,17 +2884,19 @@ static int vwsnd_audio_do_ioctl(struct inode *inode,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vwsnd_audio_ioctl(struct inode *inode,
|
static long vwsnd_audio_ioctl(struct file *file,
|
||||||
struct file *file,
|
|
||||||
unsigned int cmd,
|
unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data;
|
vwsnd_dev_t *devc = (vwsnd_dev_t *) file->private_data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
mutex_lock(&devc->io_mutex);
|
mutex_lock(&devc->io_mutex);
|
||||||
ret = vwsnd_audio_do_ioctl(inode, file, cmd, arg);
|
ret = vwsnd_audio_do_ioctl(file, cmd, arg);
|
||||||
mutex_unlock(&devc->io_mutex);
|
mutex_unlock(&devc->io_mutex);
|
||||||
|
unlock_kernel();
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3049,7 +3050,7 @@ static const struct file_operations vwsnd_audio_fops = {
|
|||||||
.read = vwsnd_audio_read,
|
.read = vwsnd_audio_read,
|
||||||
.write = vwsnd_audio_write,
|
.write = vwsnd_audio_write,
|
||||||
.poll = vwsnd_audio_poll,
|
.poll = vwsnd_audio_poll,
|
||||||
.ioctl = vwsnd_audio_ioctl,
|
.unlocked_ioctl = vwsnd_audio_ioctl,
|
||||||
.mmap = vwsnd_audio_mmap,
|
.mmap = vwsnd_audio_mmap,
|
||||||
.open = vwsnd_audio_open,
|
.open = vwsnd_audio_open,
|
||||||
.release = vwsnd_audio_release,
|
.release = vwsnd_audio_release,
|
||||||
@@ -3211,8 +3212,7 @@ static int mixer_write_ioctl(vwsnd_dev_t *devc, unsigned int nr, void __user *ar
|
|||||||
|
|
||||||
/* This is the ioctl entry to the mixer driver. */
|
/* This is the ioctl entry to the mixer driver. */
|
||||||
|
|
||||||
static int vwsnd_mixer_ioctl(struct inode *ioctl,
|
static long vwsnd_mixer_ioctl(struct file *file,
|
||||||
struct file *file,
|
|
||||||
unsigned int cmd,
|
unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
@@ -3223,6 +3223,7 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
|
|||||||
|
|
||||||
DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg);
|
DBGEV("(devc=0x%p, cmd=0x%x, arg=0x%lx)\n", devc, cmd, arg);
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
mutex_lock(&devc->mix_mutex);
|
mutex_lock(&devc->mix_mutex);
|
||||||
{
|
{
|
||||||
if ((cmd & ~nrmask) == MIXER_READ(0))
|
if ((cmd & ~nrmask) == MIXER_READ(0))
|
||||||
@@ -3233,13 +3234,14 @@ static int vwsnd_mixer_ioctl(struct inode *ioctl,
|
|||||||
retval = -EINVAL;
|
retval = -EINVAL;
|
||||||
}
|
}
|
||||||
mutex_unlock(&devc->mix_mutex);
|
mutex_unlock(&devc->mix_mutex);
|
||||||
|
unlock_kernel();
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations vwsnd_mixer_fops = {
|
static const struct file_operations vwsnd_mixer_fops = {
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.llseek = no_llseek,
|
.llseek = no_llseek,
|
||||||
.ioctl = vwsnd_mixer_ioctl,
|
.unlocked_ioctl = vwsnd_mixer_ioctl,
|
||||||
.open = vwsnd_mixer_open,
|
.open = vwsnd_mixer_open,
|
||||||
.release = vwsnd_mixer_release,
|
.release = vwsnd_mixer_release,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user