Not sure why this is hiding in the sound directory or why it has an
ancient and buggy V4L1 interface on it but it is and it needs to use
unlocked_ioctl.
Signed-off-by: Alan Cox <alan@redhat.com>
diff --git a/sound/i2c/other/tea575x-tuner.c b/sound/i2c/other/tea575x-tuner.c
index 87e3aef..c1d6184 100644
--- a/sound/i2c/other/tea575x-tuner.c
+++ b/sound/i2c/other/tea575x-tuner.c
@@ -25,6 +25,7 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <sound/core.h>
+#include <linux/smp_lock.h>
#include <sound/tea575x-tuner.h>
MODULE_AUTHOR("Jaroslav Kysela <perex@perex.cz>");
@@ -84,12 +85,14 @@ static void snd_tea575x_set_freq(struct snd_tea575x *tea)
* Linux Video interface
*/
-static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long data)
+static long snd_tea575x_ioctl(struct file *file, unsigned int cmd,
+ unsigned long data)
{
struct video_device *dev = video_devdata(file);
struct snd_tea575x *tea = video_get_drvdata(dev);
void __user *arg = (void __user *)data;
+
+#warning "Video4Linux 1 is obsolete. Please update this driver"
switch(cmd) {
case VIDIOCGCAP:
@@ -103,7 +106,9 @@ static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
v.maxheight = 0;
v.minwidth = 0;
v.minheight = 0;
+ lock_kernel();
strcpy(v.name, tea->tea5759 ? "TEA5759" : "TEA5757");
+ unlock_kernel();
if (copy_to_user(arg,&v,sizeof(v)))
return -EFAULT;
return 0;
@@ -136,13 +141,16 @@ static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
return 0;
}
case VIDIOCGFREQ:
+ /* FIXME: freq locking is needed ?? */
if(copy_to_user(arg, &tea->freq, sizeof(tea->freq)))
return -EFAULT;
return 0;
case VIDIOCSFREQ:
if(copy_from_user(&tea->freq, arg, sizeof(tea->freq)))
return -EFAULT;
+ lock_kernel();
snd_tea575x_set_freq(tea);
+ unlock_kernel();
return 0;
case VIDIOCGAUDIO:
{
@@ -158,16 +166,18 @@ static int snd_tea575x_ioctl(struct inode *inode, struct file *file,
struct video_audio v;
if(copy_from_user(&v, arg, sizeof(v)))
return -EFAULT;
+ lock_kernel();
if (tea->ops->mute)
tea->ops->mute(tea,
(v.flags &
VIDEO_AUDIO_MUTE) ? 1 : 0);
+ unlock_kernel();
if(v.audio)
return -EINVAL;
return 0;
}
default:
- return -ENOIOCTLCMD;
+ return -ENOTTY;
}
}
@@ -198,7 +208,7 @@ void snd_tea575x_init(struct snd_tea575x *tea)
tea->fops.owner = tea->card->module;
tea->fops.open = video_exclusive_open;
tea->fops.release = video_exclusive_release;
- tea->fops.ioctl = snd_tea575x_ioctl;
+ tea->fops.unlocked_ioctl = snd_tea575x_ioctl;
if (video_register_device(&tea->vd, VFL_TYPE_RADIO, tea->dev_nr - 1) < 0) {
snd_printk(KERN_ERR "unable to register tea575x tuner\n");
return;
--
| Andrew Morton | 2.6.21-rc2-mm1 |
| Greg Kroah-Hartman | [PATCH 008/196] Chinese: add translation of volatile-considered-harmful.txt |
| Herbert Xu | Re: 2.6.24-rc6-mm1 |
| S.Çağlar | Rescheduling interrupts |
git: | |
| Ken Pratt | Re: pack operation is thrashing my server |
| Linus Torvalds | Comments on recursive merge.. |
| Boyd Lynn Gerber | git-svn-import or CVS import from local HD rather than remote. |
| Marco Costalba | [PATCH 11/11] Convert sha1_file.c to use decompress helpers |
| Richard Stallman | Real men don't attack straw men |
| Douglas A. Tutty | low-MHz server |
| Juan Miscaro | When will OpenBSD support UTF8? |
| thacrazze | Multiboot Windows XP + OpenBSD doesnt work |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Arjan van de Ven | Re: [GIT]: Networking |
| David Miller | Re: [BUG] New Kernel Bugs |
| Jeff Garzik | Re: [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
