linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / media / video / saa7114.c
index 122229e..fd0a4b4 100644 (file)
@@ -45,7 +45,6 @@
 #include <asm/pgtable.h>
 #include <asm/page.h>
 #include <linux/sched.h>
-#include <asm/segment.h>
 #include <linux/types.h>
 
 #include <linux/videodev.h>
@@ -63,7 +62,7 @@ MODULE_LICENSE("GPL");
 #include <linux/video_decoder.h>
 
 static int debug = 0;
-MODULE_PARM(debug, "i");
+module_param(debug, int, 0);
 MODULE_PARM_DESC(debug, "Debug level (0-1)");
 
 #define dprintk(num, format, args...) \
@@ -163,7 +162,7 @@ saa7114_write_block (struct i2c_client *client,
                u8 block_data[32];
 
                msg.addr = client->addr;
-               msg.flags = client->flags;
+               msg.flags = 0;
                while (len >= 2) {
                        msg.buf = (char *) block_data;
                        msg.len = 0;
@@ -820,25 +819,15 @@ saa7114_command (struct i2c_client *client,
  */
 static unsigned short normal_i2c[] =
     { I2C_SAA7114 >> 1, I2C_SAA7114A >> 1, I2C_CLIENT_END };
-static unsigned short normal_i2c_range[] = { I2C_CLIENT_END };
 
-static unsigned short probe[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short probe_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short ignore_range[2] = { I2C_CLIENT_END, I2C_CLIENT_END };
-static unsigned short force[2] = { I2C_CLIENT_END , I2C_CLIENT_END };
+static unsigned short ignore = I2C_CLIENT_END;
                                                                                 
 static struct i2c_client_address_data addr_data = {
        .normal_i2c             = normal_i2c,
-       .normal_i2c_range       = normal_i2c_range,
-       .probe                  = probe,
-       .probe_range            = probe_range,
-       .ignore                 = ignore,
-       .ignore_range           = ignore_range,
-       .force                  = force
+       .probe                  = &ignore,
+       .ignore                 = &ignore,
 };
 
-static int saa7114_i2c_id = 0;
 static struct i2c_driver i2c_driver_saa7114;
 
 static int
@@ -863,24 +852,19 @@ saa7114_detect_client (struct i2c_adapter *adapter,
        if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return 0;
 
-       client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL);
+       client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL);
        if (client == 0)
                return -ENOMEM;
-       memset(client, 0, sizeof(struct i2c_client));
        client->addr = address;
        client->adapter = adapter;
        client->driver = &i2c_driver_saa7114;
-       client->flags = I2C_CLIENT_ALLOW_USE;
-       client->id = saa7114_i2c_id++;
-       snprintf(I2C_NAME(client), sizeof(I2C_NAME(client)) - 1,
-               "saa7114[%d]", client->id);
+       strlcpy(I2C_NAME(client), "saa7114", sizeof(I2C_NAME(client)));
 
-       decoder = kmalloc(sizeof(struct saa7114), GFP_KERNEL);
+       decoder = kzalloc(sizeof(struct saa7114), GFP_KERNEL);
        if (decoder == NULL) {
                kfree(client);
                return -ENOMEM;
        }
-       memset(decoder, 0, sizeof(struct saa7114));
        decoder->norm = VIDEO_MODE_NTSC;
        decoder->input = -1;
        decoder->enable = 1;
@@ -1217,11 +1201,11 @@ saa7114_detach_client (struct i2c_client *client)
 /* ----------------------------------------------------------------------- */
 
 static struct i2c_driver i2c_driver_saa7114 = {
-       .owner = THIS_MODULE,
-       .name = "saa7114",
+       .driver = {
+               .name = "saa7114",
+       },
 
        .id = I2C_DRIVERID_SAA7114,
-       .flags = I2C_DF_NOTIFY,
 
        .attach_adapter = saa7114_attach_adapter,
        .detach_client = saa7114_detach_client,