Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d209974c authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Takashi Iwai
Browse files

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: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 90dc763f
Loading
Loading
Loading
Loading
+34 −20
Original line number Diff line number Diff line
@@ -827,22 +827,26 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
	return codec->mixer_ioctl(codec, cmd, arg);
}

static int
au1550_ioctl_mixdev(struct inode *inode, struct file *file,
			       unsigned int cmd, unsigned long arg)
static long
au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
{
	struct au1550_state *s = (struct au1550_state *)file->private_data;
	struct ac97_codec *codec = s->codec;
	int ret;

	lock_kernel();
	ret = mixdev_ioctl(codec, cmd, arg);
	unlock_kernel();

	return mixdev_ioctl(codec, cmd, arg);
	return ret;
}

static /*const */ struct file_operations au1550_mixer_fops = {
	owner:THIS_MODULE,
	llseek:au1550_llseek,
	ioctl:au1550_ioctl_mixdev,
	open:au1550_open_mixdev,
	release:au1550_release_mixdev,
	.owner		= THIS_MODULE,
	.llseek		= au1550_llseek,
	.unlocked_ioctl	= au1550_ioctl_mixdev,
	.open		= au1550_open_mixdev,
	.release	= au1550_release_mixdev,
};

static int
@@ -1346,8 +1350,7 @@ dma_count_done(struct dmabuf *db)


static int
au1550_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
							unsigned long arg)
au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
	struct au1550_state *s = (struct au1550_state *)file->private_data;
	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);
}

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
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 = {
	owner:		THIS_MODULE,
	llseek:		au1550_llseek,
	read:		au1550_read,
	write:		au1550_write,
	poll:		au1550_poll,
	ioctl:		au1550_ioctl,
	mmap:		au1550_mmap,
	open:		au1550_open,
	release:	au1550_release,
	.owner		= THIS_MODULE,
	.llseek		= au1550_llseek,
	.read		= au1550_read,
	.write		= au1550_write,
	.poll		= au1550_poll,
	.unlocked_ioctl	= au1550_unlocked_ioctl,
	.mmap		= au1550_mmap,
	.open		= au1550_open,
	.release	= au1550_release,
};

MODULE_AUTHOR("Advanced Micro Devices (AMD), dan@embeddededge.com");
+28 −7
Original line number Diff line number Diff line
@@ -341,8 +341,8 @@ static int mixer_release(struct inode *inode, struct file *file)
	unlock_kernel();
	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)
	    mixer.modify_counter++;
@@ -366,11 +366,22 @@ static int mixer_ioctl(struct inode *inode, struct file *file, u_int cmd,
	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 =
{
	.owner		= THIS_MODULE,
	.llseek		= no_llseek,
	.ioctl		= mixer_ioctl,
	.unlocked_ioctl	= mixer_unlocked_ioctl,
	.open		= mixer_open,
	.release	= mixer_release,
};
@@ -963,8 +974,7 @@ printk("dmasound_core: tried to set_queue_frags on a locked queue\n") ;
	return 0 ;
}

static int sq_ioctl(struct inode *inode, struct file *file, u_int cmd,
		    u_long arg)
static int sq_ioctl(struct file *file, u_int cmd, u_long arg)
{
	int val, result;
	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);

	default:
		return mixer_ioctl(inode, file, cmd, arg);
		return mixer_ioctl(file, cmd, arg);
	}
	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 =
{
	.owner		= THIS_MODULE,
	.llseek		= no_llseek,
	.write		= sq_write,
	.poll		= sq_poll,
	.ioctl		= sq_ioctl,
	.unlocked_ioctl	= sq_unlocked_ioctl,
	.open		= sq_open,
	.release	= sq_release,
};
+10 −5
Original line number Diff line number Diff line
@@ -639,21 +639,26 @@ static int mixer_ioctl(unsigned int cmd, unsigned long arg)
	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 ret;

	if (cmd == OSS_GETVERSION) {
		int sound_version = SOUND_VERSION;
		return put_user(sound_version, (int __user *)arg);
	}

	ret = -EINVAL;

	lock_kernel();
	if (minor == dev.dsp_minor)
		return dsp_ioctl(file, cmd, arg);
		ret = dsp_ioctl(file, cmd, arg);
	else if (minor == dev.mixer_minor)
		return mixer_ioctl(cmd, arg);
		ret = mixer_ioctl(cmd, arg);
	unlock_kernel();

	return -EINVAL;
	return ret;
}

static void dsp_write_flush(void)
@@ -1109,7 +1114,7 @@ static const struct file_operations dev_fileops = {
	.owner		= THIS_MODULE,
	.read		= dev_read,
	.write		= dev_write,
	.ioctl		= dev_ioctl,
	.unlocked_ioctl	= dev_ioctl,
	.open		= dev_open,
	.release	= dev_release,
};
+15 −3
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#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>
@@ -93,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;
@@ -159,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)
{
@@ -243,7 +255,7 @@ 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,
      .unlocked_ioctl =	dac_audio_unlocked_ioctl,
      .open =		dac_audio_open,
      .release =	dac_audio_release,
};
+19 −5
Original line number Diff line number Diff line
@@ -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)
{
	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);
	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 = {
	.owner		= THIS_MODULE,
	.llseek		= no_llseek,
	.ioctl		= cs4297a_ioctl_mixdev,
	.unlocked_ioctl	= cs4297a_ioctl_mixdev,
	.open		= cs4297a_open_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)
{
	struct cs4297a_state *s =
@@ -2342,6 +2346,16 @@ static int cs4297a_ioctl(struct inode *inode, struct file *file,
	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)
{
@@ -2511,7 +2525,7 @@ static const struct file_operations cs4297a_audio_fops = {
	.read		= cs4297a_read,
	.write		= cs4297a_write,
	.poll		= cs4297a_poll,
	.ioctl		= cs4297a_ioctl,
	.unlocked_ioctl	= cs4297a_unlocked_ioctl,
	.mmap		= cs4297a_mmap,
	.open		= cs4297a_open,
	.release	= cs4297a_release,
Loading