summaryrefslogtreecommitdiff
path: root/drivers/media/video/tvaudio.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-05-11 17:09:24 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-05-11 17:09:24 -0700
commit57014123512633ab0c38a4fea4140bf156f6a3a0 (patch)
treea46e864f9c508d8228e79928519742af6a42b7e4 /drivers/media/video/tvaudio.c
parentc3921ab71507b108d51a0f1ee960f80cd668a93d (diff)
parentae429083efe996ca2c569c44fd6fea440676dc33 (diff)
Merge branch 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6
* 'i2c-for-linus' of git://jdelvare.pck.nerim.net/jdelvare-2.6: i2c: Convert some more new-style drivers to use module aliasing i2c: Match dummy devices by type i2c-sibyte: Mark i2c_sibyte_add_bus() as static i2c-sibyte: Correct a comment about frequency i2c: Improve the functionality documentation i2c: Improve smbus-protocol documentation i2c-piix4: Blacklist two mainboards i2c-piix4: Increase the intitial delay for the ServerWorks CSB5 i2c-mpc: Compare to NO_IRQ instead of zero
Diffstat (limited to 'drivers/media/video/tvaudio.c')
-rw-r--r--drivers/media/video/tvaudio.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/media/video/tvaudio.c b/drivers/media/video/tvaudio.c
index 6f9945b04e1..c77914d99d1 100644
--- a/drivers/media/video/tvaudio.c
+++ b/drivers/media/video/tvaudio.c
@@ -1505,7 +1505,8 @@ static int chip_probe(struct i2c_client *client, const struct i2c_device_id *id)
}
/* fill required data structures */
- strcpy(client->name, desc->name);
+ if (!id)
+ strlcpy(client->name, desc->name, I2C_NAME_SIZE);
chip->type = desc-chiplist;
chip->shadow.count = desc->registers+1;
chip->prevmode = -1;
@@ -1830,6 +1831,15 @@ static int chip_legacy_probe(struct i2c_adapter *adap)
return 0;
}
+/* This driver supports many devices and the idea is to let the driver
+ detect which device is present. So rather than listing all supported
+ devices here, we pretend to support a single, fake device type. */
+static const struct i2c_device_id chip_id[] = {
+ { "tvaudio", 0 },
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, chip_id);
+
static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.name = "tvaudio",
.driverid = I2C_DRIVERID_TVAUDIO,
@@ -1837,6 +1847,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.probe = chip_probe,
.remove = chip_remove,
.legacy_probe = chip_legacy_probe,
+ .id_table = chip_id,
};
/*