diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-05-18 14:49:40 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2008-05-18 14:49:40 -0400 |
commit | af294867a52bf718df835a688e8c786d550bee26 (patch) | |
tree | 9800d202fd40ba2f8978d3138e28319460038802 /drivers/media/video/tuner-core.c | |
parent | 238a871e41ffbd9ba6608cac7c8b74549ac3bb9b (diff) |
i2c: Convert remaining new-style drivers to use module aliasing
Update all the remaining new-style i2c drivers to use standard module
aliasing instead of the old driver_name/type driver matching scheme.
Note that the tuner driver is a bit quirky at the moment, as it
overwrites i2c_client.name with arbitrary strings. We write "tuner"
back on remove, to make sure that driver cycling will work properly,
but there may still be troublesome corner cases.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/media/video/tuner-core.c')
-rw-r--r-- | drivers/media/video/tuner-core.c | 17 |
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, | |||
1115 | if (NULL == t) | 1115 | if (NULL == t) |
1116 | return -ENOMEM; | 1116 | return -ENOMEM; |
1117 | t->i2c = client; | 1117 | t->i2c = client; |
1118 | strlcpy(client->name, "(tuner unset)", sizeof(client->name)); | ||
1119 | i2c_set_clientdata(client, t); | 1118 | i2c_set_clientdata(client, t); |
1120 | t->type = UNSET; | 1119 | t->type = UNSET; |
1121 | t->audmode = V4L2_TUNER_MODE_STEREO; | 1120 | t->audmode = V4L2_TUNER_MODE_STEREO; |
@@ -1273,11 +1272,26 @@ static int tuner_remove(struct i2c_client *client) | |||
1273 | 1272 | ||
1274 | list_del(&t->list); | 1273 | list_del(&t->list); |
1275 | kfree(t); | 1274 | kfree(t); |
1275 | |||
1276 | /* The probing code has overwritten the device name, restore it so | ||
1277 | that reloading the driver will work. Ideally the device name | ||
1278 | should not be overwritten in the first place, but for now that | ||
1279 | will do. */ | ||
1280 | strlcpy(client->name, "tuner", I2C_NAME_SIZE); | ||
1276 | return 0; | 1281 | return 0; |
1277 | } | 1282 | } |
1278 | 1283 | ||
1279 | /* ----------------------------------------------------------------------- */ | 1284 | /* ----------------------------------------------------------------------- */ |
1280 | 1285 | ||
1286 | /* This driver supports many devices and the idea is to let the driver | ||
1287 | detect which device is present. So rather than listing all supported | ||
1288 | devices here, we pretend to support a single, fake device type. */ | ||
1289 | static const struct i2c_device_id tuner_id[] = { | ||
1290 | { "tuner", }, /* autodetect */ | ||
1291 | { } | ||
1292 | }; | ||
1293 | MODULE_DEVICE_TABLE(i2c, tuner_id); | ||
1294 | |||
1281 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { | 1295 | static struct v4l2_i2c_driver_data v4l2_i2c_data = { |
1282 | .name = "tuner", | 1296 | .name = "tuner", |
1283 | .driverid = I2C_DRIVERID_TUNER, | 1297 | .driverid = I2C_DRIVERID_TUNER, |
@@ -1287,6 +1301,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = { | |||
1287 | .suspend = tuner_suspend, | 1301 | .suspend = tuner_suspend, |
1288 | .resume = tuner_resume, | 1302 | .resume = tuner_resume, |
1289 | .legacy_probe = tuner_legacy_probe, | 1303 | .legacy_probe = tuner_legacy_probe, |
1304 | .id_table = tuner_id, | ||
1290 | }; | 1305 | }; |
1291 | 1306 | ||
1292 | 1307 | ||