]> err.no Git - linux-2.6/blobdiff - drivers/media/video/m52790.c
RDMA/cxgb3: Fix regression caused by class_device -> device conversion
[linux-2.6] / drivers / media / video / m52790.c
index 4d2a52204ad49bf6d12c8eb350273de44be0ca30..8e0160d275ca53aaf3ac27874bfa62dcfd3a7799 100644 (file)
@@ -30,7 +30,7 @@
 #include <media/m52790.h>
 #include <media/v4l2-common.h>
 #include <media/v4l2-chip-ident.h>
-#include <media/v4l2-i2c-drv-legacy.h>
+#include <media/v4l2-i2c-drv.h>
 
 MODULE_DESCRIPTION("i2c device driver for m52790 A/V switch");
 MODULE_AUTHOR("Hans Verkuil");
@@ -126,7 +126,8 @@ static int m52790_command(struct i2c_client *client, unsigned int cmd,
 
 /* i2c implementation */
 
-static int m52790_probe(struct i2c_client *client)
+static int m52790_probe(struct i2c_client *client,
+                       const struct i2c_device_id *id)
 {
        struct m52790_state *state;
 
@@ -134,8 +135,6 @@ static int m52790_probe(struct i2c_client *client)
        if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
                return -EIO;
 
-       snprintf(client->name, sizeof(client->name) - 1, "m52790");
-
        v4l_info(client, "chip found @ 0x%x (%s)\n",
                        client->addr << 1, client->adapter->name);
 
@@ -158,11 +157,18 @@ static int m52790_remove(struct i2c_client *client)
 
 /* ----------------------------------------------------------------------- */
 
+static const struct i2c_device_id m52790_id[] = {
+       { "m52790", 0 },
+       { }
+};
+MODULE_DEVICE_TABLE(i2c, m52790_id);
+
 static struct v4l2_i2c_driver_data v4l2_i2c_data = {
        .name = "m52790",
        .driverid = I2C_DRIVERID_M52790,
        .command = m52790_command,
        .probe = m52790_probe,
        .remove = m52790_remove,
+       .id_table = m52790_id,
 };