Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-drm-fsl-dcu.git] / drivers / media / video / saa6588.c
index d60a783e04730b53c67c1a0b6ca5f4a8e2a8dfd3..92eabf88a09b72e336ce55ea1b4f4901b432ce18 100644 (file)
@@ -32,7 +32,7 @@
 #include <asm/uaccess.h>
 
 
-#include "rds.h"
+#include <media/rds.h>
 
 /* Addresses to scan */
 static unsigned short normal_i2c[] = {
@@ -50,15 +50,15 @@ static unsigned int rbds = 0;
 static unsigned int plvl = 0;
 static unsigned int bufblocks = 100;
 
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "enable debug messages");
-MODULE_PARM(xtal, "i");
+module_param(xtal, int, 0);
 MODULE_PARM_DESC(xtal, "select oscillator frequency (0..3), default 0");
-MODULE_PARM(rbds, "i");
+module_param(rbds, int, 0);
 MODULE_PARM_DESC(rbds, "select mode, 0=RDS, 1=RBDS, default 0");
-MODULE_PARM(plvl, "i");
+module_param(plvl, int, 0);
 MODULE_PARM_DESC(plvl, "select pause level (0..3), default 0");
-MODULE_PARM(bufblocks, "i");
+module_param(bufblocks, int, 0);
 MODULE_PARM_DESC(bufblocks, "number of buffered blocks, default 100");
 
 MODULE_DESCRIPTION("v4l2 driver module for SAA6588 RDS decoder");
@@ -212,8 +212,10 @@ static void read_from_buf(struct saa6588 *s, struct rds_command *a)
        if (rd_blocks > s->block_count)
                rd_blocks = s->block_count;
 
-       if (!rd_blocks)
+       if (!rd_blocks) {
+               spin_unlock_irqrestore(&s->lock, flags);
                return;
+       }
 
        for (i = 0; i < rd_blocks; i++) {
                if (block_to_user_buf(s, buf_ptr)) {
@@ -322,9 +324,9 @@ static void saa6588_timer(unsigned long data)
        schedule_work(&s->work);
 }
 
-static void saa6588_work(void *data)
+static void saa6588_work(struct work_struct *work)
 {
-       struct saa6588 *s = (struct saa6588 *)data;
+       struct saa6588 *s = container_of(work, struct saa6588, work);
 
        saa6588_i2c_poll(s);
        mod_timer(&s->timer, jiffies + msecs_to_jiffies(20));
@@ -417,7 +419,7 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, int kind)
        saa6588_configure(s);
 
        /* start polling via eventd */
-       INIT_WORK(&s->work, saa6588_work, s);
+       INIT_WORK(&s->work, saa6588_work);
        init_timer(&s->timer);
        s->timer.function = saa6588_timer;
        s->timer.data = (unsigned long)s;
@@ -427,18 +429,8 @@ static int saa6588_attach(struct i2c_adapter *adap, int addr, int kind)
 
 static int saa6588_probe(struct i2c_adapter *adap)
 {
-#ifdef I2C_CLASS_TV_ANALOG
        if (adap->class & I2C_CLASS_TV_ANALOG)
                return i2c_probe(adap, &addr_data, saa6588_attach);
-#else
-       switch (adap->id) {
-       case I2C_HW_B_BT848:
-       case I2C_HW_B_RIVA:
-       case I2C_HW_SAA7134:
-               return i2c_probe(adap, &addr_data, saa6588_attach);
-               break;
-       }
-#endif
        return 0;
 }
 
@@ -496,7 +488,7 @@ static int saa6588_command(struct i2c_client *client, unsigned int cmd,
 
 static struct i2c_driver driver = {
        .driver = {
-               .name = "i2c saa6588 driver",
+               .name = "saa6588",
        },
        .id = -1,               /* FIXME */
        .attach_adapter = saa6588_probe,