summaryrefslogtreecommitdiff
path: root/drivers/media/video/tuner-core.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-05-19 09:23:07 +0200
committerIngo Molnar <mingo@elte.hu>2008-05-19 09:23:07 +0200
commita8ac1ae3a2a8ceb5bc1d334a502d42f59b91379c (patch)
treefa3c8e81ffa64798e85425cf139fdd6ba3fd7963 /drivers/media/video/tuner-core.c
parentb4ef290d7c3abd1bf8cefcf8def359537fda7f31 (diff)
parentb8291ad07a7f3b5b990900f0001198ac23ba893e (diff)
Merge branch 'linus' into x86/pattip-x86-pat-2008-05-19-07-23-07
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r--drivers/media/video/tuner-core.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c
index 5a75788b92ae..198f0afb812e 100644
--- a/drivers/media/video/tuner-core.c
+++ b/drivers/media/video/tuner-core.c
@@ -1115,7 +1115,6 @@ static int tuner_probe(struct i2c_client *client,
if (NULL == t)
return -ENOMEM;
t->i2c = client;
- strlcpy(client->name, "(tuner unset)", sizeof(client->name));
i2c_set_clientdata(client, t);
t->type = UNSET;
t->audmode = V4L2_TUNER_MODE_STEREO;
@@ -1273,11 +1272,26 @@ static int tuner_remove(struct i2c_client *client)
list_del(&t->list);
kfree(t);
+
+ /* The probing code has overwritten the device name, restore it so
+ that reloading the driver will work. Ideally the device name
+ should not be overwritten in the first place, but for now that
+ will do. */
+ strlcpy(client->name, "tuner", I2C_NAME_SIZE);
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 tuner_id[] = {
+ { "tuner", }, /* autodetect */
+ { }
+};
+MODULE_DEVICE_TABLE(i2c, tuner_id);
+
static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.name = "tuner",
.driverid = I2C_DRIVERID_TUNER,
@@ -1287,6 +1301,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
.suspend = tuner_suspend,
.resume = tuner_resume,
.legacy_probe = tuner_legacy_probe,
+ .id_table = tuner_id,
};