]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/radio/radio-cadet.c
V4L/DVB (8482): videodev: move all ioctl callbacks to a new v4l2_ioctl_ops struct
[linux-2.6-omap-h63xx.git] / drivers / media / radio / radio-cadet.c
index 8cf2e9df5c8aa0ae5365d2293b1e53c9c417669e..36b850fc14b4076225e13b1dcf3ef6bda441cdbe 100644 (file)
@@ -39,6 +39,7 @@
 #include <asm/uaccess.h>       /* copy to/from user            */
 #include <linux/videodev2.h>   /* V4L2 API defs                */
 #include <media/v4l2-common.h>
+#include <media/v4l2-ioctl.h>
 #include <linux/param.h>
 #include <linux/pnp.h>
 
@@ -69,13 +70,13 @@ static struct v4l2_queryctrl radio_qctrl[] = {
 
 static int io=-1;              /* default to isapnp activation */
 static int radio_nr = -1;
-static int users=0;
-static int curtuner=0;
-static int tunestat=0;
-static int sigstrength=0;
+static int users;
+static int curtuner;
+static int tunestat;
+static int sigstrength;
 static wait_queue_head_t read_queue;
 static struct timer_list readtimer;
-static __u8 rdsin=0,rdsout=0,rdsstat=0;
+static __u8 rdsin, rdsout, rdsstat;
 static unsigned char rdsbuf[RDS_BUFFER];
 static spinlock_t cadet_io_lock;
 
@@ -329,7 +330,7 @@ cadet_handler(unsigned long data)
        init_timer(&readtimer);
        readtimer.function=cadet_handler;
        readtimer.data=(unsigned long)0;
-       readtimer.expires=jiffies+(HZ/20);
+       readtimer.expires=jiffies+msecs_to_jiffies(50);
        add_timer(&readtimer);
 }
 
@@ -349,7 +350,7 @@ cadet_read(struct file *file, char __user *data, size_t count, loff_t *ppos)
                init_timer(&readtimer);
                readtimer.function=cadet_handler;
                readtimer.data=(unsigned long)0;
-               readtimer.expires=jiffies+(HZ/20);
+               readtimer.expires=jiffies+msecs_to_jiffies(50);
                add_timer(&readtimer);
        }
        if(rdsin==rdsout) {
@@ -563,16 +564,13 @@ static const struct file_operations cadet_fops = {
        .read           = cadet_read,
        .ioctl          = video_ioctl2,
        .poll           = cadet_poll,
+#ifdef CONFIG_COMPAT
        .compat_ioctl   = v4l_compat_ioctl32,
+#endif
        .llseek         = no_llseek,
 };
 
-static struct video_device cadet_radio=
-{
-       .owner          = THIS_MODULE,
-       .name           = "Cadet radio",
-       .type           = VID_TYPE_TUNER,
-       .fops           = &cadet_fops,
+static const struct v4l2_ioctl_ops cadet_ioctl_ops = {
        .vidioc_querycap    = vidioc_querycap,
        .vidioc_g_tuner     = vidioc_g_tuner,
        .vidioc_s_tuner     = vidioc_s_tuner,
@@ -587,6 +585,16 @@ static struct video_device cadet_radio=
        .vidioc_s_input     = vidioc_s_input,
 };
 
+static struct video_device cadet_radio = {
+       .owner          = THIS_MODULE,
+       .name           = "Cadet radio",
+       .type           = VID_TYPE_TUNER,
+       .fops           = &cadet_fops,
+       .ioctl_ops      = &cadet_ioctl_ops,
+};
+
+#ifdef CONFIG_PNP
+
 static struct pnp_device_id cadet_pnp_devices[] = {
        /* ADS Cadet AM/FM Radio Card */
        {.id = "MSM0c24", .driver_data = 0},
@@ -621,6 +629,10 @@ static struct pnp_driver cadet_pnp_driver = {
        .remove         = NULL,
 };
 
+#else
+static struct pnp_driver cadet_pnp_driver;
+#endif
+
 static int cadet_probe(void)
 {
        static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e};