]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/saa5249.c
V4L/DVB (7547): em28xx: Fix a broken lock
[linux-2.6-omap-h63xx.git] / drivers / media / video / saa5249.c
index f2a2f34cd6261cf6e909d2fc9c278c5eed584a4b..ec8c65dc8408506ae02786a4dc7e2e982f63f21f 100644 (file)
@@ -86,9 +86,9 @@ static const int disp_modes[8][3] =
 
 
 
-#define PAGE_WAIT (300*HZ/1000)                        /* Time between requesting page and */
+#define PAGE_WAIT    msecs_to_jiffies(300)     /* Time between requesting page and */
                                                /* checking status bits */
-#define PGBUF_EXPIRE (15*HZ)                   /* Time to wait before retransmitting */
+#define PGBUF_EXPIRE msecs_to_jiffies(15000)   /* Time to wait before retransmitting */
                                                /* page regardless of infobits */
 typedef struct {
        u8 pgbuf[VTX_VIRTUALSIZE];              /* Page-buffer */
@@ -115,8 +115,8 @@ struct saa5249_device
 #define CCTWR 34               /* I²C write/read-address of vtx-chip */
 #define CCTRD 35
 #define NOACK_REPEAT 10                /* Retry access this many times on failure */
-#define CLEAR_DELAY (HZ/20)    /* Time required to clear a page */
-#define READY_TIMEOUT (30*HZ/1000)     /* Time to wait for ready signal of I²C-bus interface */
+#define CLEAR_DELAY   msecs_to_jiffies(50)     /* Time required to clear a page */
+#define READY_TIMEOUT msecs_to_jiffies(30)     /* Time to wait for ready signal of I2C-bus interface */
 #define INIT_DELAY 500         /* Time in usec to wait at initialization of CEA interface */
 #define START_DELAY 10         /* Time in usec to wait before starting write-cycle (CEA) */
 
@@ -282,19 +282,21 @@ static int i2c_senddata(struct saa5249_device *t, ...)
 {
        unsigned char buf[64];
        int v;
-       int ct=0;
+       int ct = 0;
        va_list argp;
        va_start(argp,t);
 
-       while((v=va_arg(argp,int))!=-1)
-               buf[ct++]=v;
+       while ((v = va_arg(argp, int)) != -1)
+               buf[ct++] = v;
+
+       va_end(argp);
        return i2c_sendbuf(t, buf[0], ct-1, buf+1);
 }
 
-/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop
+/* Get count number of bytes from I²C-device at address adr, store them in buf. Start & stop
  * handshaking is done by this routine, ack will be sent after the last byte to inhibit further
  * sending of data. If uaccess is 'true', data is written to user-space with put_user.
- * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise
+ * Returns -1 if I²C-device didn't send acknowledge, 0 otherwise
  */
 
 static int i2c_getdata(struct saa5249_device *t, int count, u8 *buf)
@@ -699,7 +701,9 @@ static const struct file_operations saa_fops = {
        .open           = saa5249_open,
        .release        = saa5249_release,
        .ioctl          = saa5249_ioctl,
+#ifdef CONFIG_COMPAT
        .compat_ioctl   = v4l_compat_ioctl32,
+#endif
        .llseek         = no_llseek,
 };