aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-05-18 14:49:40 -0400
committerJean Delvare <khali@hyperion.delvare>2008-05-18 14:49:40 -0400
commitaf294867a52bf718df835a688e8c786d550bee26 (patch)
tree9800d202fd40ba2f8978d3138e28319460038802
parent238a871e41ffbd9ba6608cac7c8b74549ac3bb9b (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>
-rw-r--r--drivers/media/video/cs5345.c7
-rw-r--r--drivers/media/video/cs53l32a.c10
-rw-r--r--drivers/media/video/cx18/cx18-i2c.c9
-rw-r--r--drivers/media/video/cx25840/cx25840-core.c7
-rw-r--r--drivers/media/video/ivtv/ivtv-i2c.c13
-rw-r--r--drivers/media/video/m52790.c9
-rw-r--r--drivers/media/video/msp3400-driver.c17
-rw-r--r--drivers/media/video/saa7115.c40
-rw-r--r--drivers/media/video/saa7127.c9
-rw-r--r--drivers/media/video/saa717x.c9
-rw-r--r--drivers/media/video/tuner-core.c17
-rw-r--r--drivers/media/video/upd64031a.c6
-rw-r--r--drivers/media/video/upd64083.c6
-rw-r--r--drivers/media/video/vp27smpx.c9
-rw-r--r--drivers/media/video/wm8739.c7
-rw-r--r--drivers/media/video/wm8775.c7
16 files changed, 143 insertions, 39 deletions
diff --git a/drivers/media/video/cs5345.c b/drivers/media/video/cs5345.c
index 2a429f9e32cd..03411503457e 100644
--- a/drivers/media/video/cs5345.c
+++ b/drivers/media/video/cs5345.c
@@ -160,10 +160,17 @@ static int cs5345_probe(struct i2c_client *client,
160 160
161/* ----------------------------------------------------------------------- */ 161/* ----------------------------------------------------------------------- */
162 162
163static const struct i2c_device_id cs5345_id[] = {
164 { "cs5345", 0 },
165 { }
166};
167MODULE_DEVICE_TABLE(i2c, cs5345_id);
168
163static struct v4l2_i2c_driver_data v4l2_i2c_data = { 169static struct v4l2_i2c_driver_data v4l2_i2c_data = {
164 .name = "cs5345", 170 .name = "cs5345",
165 .driverid = I2C_DRIVERID_CS5345, 171 .driverid = I2C_DRIVERID_CS5345,
166 .command = cs5345_command, 172 .command = cs5345_command,
167 .probe = cs5345_probe, 173 .probe = cs5345_probe,
174 .id_table = cs5345_id,
168}; 175};
169 176
diff --git a/drivers/media/video/cs53l32a.c b/drivers/media/video/cs53l32a.c
index 2dfd0afc62db..d965af860ab2 100644
--- a/drivers/media/video/cs53l32a.c
+++ b/drivers/media/video/cs53l32a.c
@@ -144,7 +144,8 @@ static int cs53l32a_probe(struct i2c_client *client,
144 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 144 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
145 return -EIO; 145 return -EIO;
146 146
147 snprintf(client->name, sizeof(client->name) - 1, "cs53l32a"); 147 if (!id)
148 strlcpy(client->name, "cs53l32a", sizeof(client->name));
148 149
149 v4l_info(client, "chip found @ 0x%x (%s)\n", 150 v4l_info(client, "chip found @ 0x%x (%s)\n",
150 client->addr << 1, client->adapter->name); 151 client->addr << 1, client->adapter->name);
@@ -175,10 +176,17 @@ static int cs53l32a_probe(struct i2c_client *client,
175 return 0; 176 return 0;
176} 177}
177 178
179static const struct i2c_device_id cs53l32a_id[] = {
180 { "cs53l32a", 0 },
181 { }
182};
183MODULE_DEVICE_TABLE(i2c, cs53l32a_id);
184
178static struct v4l2_i2c_driver_data v4l2_i2c_data = { 185static struct v4l2_i2c_driver_data v4l2_i2c_data = {
179 .name = "cs53l32a", 186 .name = "cs53l32a",
180 .driverid = I2C_DRIVERID_CS53L32A, 187 .driverid = I2C_DRIVERID_CS53L32A,
181 .command = cs53l32a_command, 188 .command = cs53l32a_command,
182 .probe = cs53l32a_probe, 189 .probe = cs53l32a_probe,
190 .id_table = cs53l32a_id,
183}; 191};
184 192
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 4f08a4058d1a..1d6c51a75313 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -74,7 +74,7 @@ static const u8 hw_bus[] = {
74}; 74};
75 75
76/* This array should match the CX18_HW_ defines */ 76/* This array should match the CX18_HW_ defines */
77static const char * const hw_drivernames[] = { 77static const char * const hw_devicenames[] = {
78 "tuner", 78 "tuner",
79 "tveeprom", 79 "tveeprom",
80 "cs5345", 80 "cs5345",
@@ -95,8 +95,7 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
95 id = hw_driverids[idx]; 95 id = hw_driverids[idx];
96 bus = hw_bus[idx]; 96 bus = hw_bus[idx];
97 memset(&info, 0, sizeof(info)); 97 memset(&info, 0, sizeof(info));
98 strlcpy(info.driver_name, hw_drivernames[idx], 98 strlcpy(info.type, hw_devicenames[idx], sizeof(info.type));
99 sizeof(info.driver_name));
100 info.addr = hw_addrs[idx]; 99 info.addr = hw_addrs[idx];
101 for (i = 0; i < I2C_CLIENTS_MAX; i++) 100 for (i = 0; i < I2C_CLIENTS_MAX; i++)
102 if (cx->i2c_clients[i] == NULL) 101 if (cx->i2c_clients[i] == NULL)
@@ -279,7 +278,7 @@ static const char *cx18_i2c_id_name(u32 id)
279 278
280 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 279 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
281 if (hw_driverids[i] == id) 280 if (hw_driverids[i] == id)
282 return hw_drivernames[i]; 281 return hw_devicenames[i];
283 return "unknown device"; 282 return "unknown device";
284} 283}
285 284
@@ -290,7 +289,7 @@ static const char *cx18_i2c_hw_name(u32 hw)
290 289
291 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 290 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
292 if (1 << i == hw) 291 if (1 << i == hw)
293 return hw_drivernames[i]; 292 return hw_devicenames[i];
294 return "unknown device"; 293 return "unknown device";
295} 294}
296 295
diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c
index 88823810497c..607efdcd22f8 100644
--- a/drivers/media/video/cx25840/cx25840-core.c
+++ b/drivers/media/video/cx25840/cx25840-core.c
@@ -1284,10 +1284,17 @@ static int cx25840_remove(struct i2c_client *client)
1284 return 0; 1284 return 0;
1285} 1285}
1286 1286
1287static const struct i2c_device_id cx25840_id[] = {
1288 { "cx25840", 0 },
1289 { }
1290};
1291MODULE_DEVICE_TABLE(i2c, cx25840_id);
1292
1287static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1293static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1288 .name = "cx25840", 1294 .name = "cx25840",
1289 .driverid = I2C_DRIVERID_CX25840, 1295 .driverid = I2C_DRIVERID_CX25840,
1290 .command = cx25840_command, 1296 .command = cx25840_command,
1291 .probe = cx25840_probe, 1297 .probe = cx25840_probe,
1292 .remove = cx25840_remove, 1298 .remove = cx25840_remove,
1299 .id_table = cx25840_id,
1293}; 1300};
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index 771adf47e944..32129f3ea836 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -136,7 +136,7 @@ static const u8 hw_addrs[] = {
136}; 136};
137 137
138/* This array should match the IVTV_HW_ defines */ 138/* This array should match the IVTV_HW_ defines */
139static const char * const hw_drivernames[] = { 139static const char * const hw_devicenames[] = {
140 "cx25840", 140 "cx25840",
141 "saa7115", 141 "saa7115",
142 "saa7127", 142 "saa7127",
@@ -145,7 +145,7 @@ static const char * const hw_drivernames[] = {
145 "wm8775", 145 "wm8775",
146 "cs53l32a", 146 "cs53l32a",
147 "tveeprom", 147 "tveeprom",
148 "saa7115", 148 "saa7114",
149 "upd64031a", 149 "upd64031a",
150 "upd64083", 150 "upd64083",
151 "saa717x", 151 "saa717x",
@@ -167,8 +167,7 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
167 return -1; 167 return -1;
168 id = hw_driverids[idx]; 168 id = hw_driverids[idx];
169 memset(&info, 0, sizeof(info)); 169 memset(&info, 0, sizeof(info));
170 strlcpy(info.driver_name, hw_drivernames[idx], 170 strlcpy(info.type, hw_devicenames[idx], sizeof(info.type));
171 sizeof(info.driver_name));
172 info.addr = hw_addrs[idx]; 171 info.addr = hw_addrs[idx];
173 for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {} 172 for (i = 0; itv->i2c_clients[i] && i < I2C_CLIENTS_MAX; i++) {}
174 173
@@ -657,7 +656,7 @@ static const char *ivtv_i2c_id_name(u32 id)
657 656
658 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 657 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
659 if (hw_driverids[i] == id) 658 if (hw_driverids[i] == id)
660 return hw_drivernames[i]; 659 return hw_devicenames[i];
661 return "unknown device"; 660 return "unknown device";
662} 661}
663 662
@@ -668,7 +667,7 @@ static const char *ivtv_i2c_hw_name(u32 hw)
668 667
669 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++) 668 for (i = 0; i < ARRAY_SIZE(hw_driverids); i++)
670 if (1 << i == hw) 669 if (1 << i == hw)
671 return hw_drivernames[i]; 670 return hw_devicenames[i];
672 return "unknown device"; 671 return "unknown device";
673} 672}
674 673
@@ -770,7 +769,7 @@ int init_ivtv_i2c(struct ivtv *itv)
770 * same size and GPIO must be the last entry. 769 * same size and GPIO must be the last entry.
771 */ 770 */
772 if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) || 771 if (ARRAY_SIZE(hw_driverids) != ARRAY_SIZE(hw_addrs) ||
773 ARRAY_SIZE(hw_drivernames) != ARRAY_SIZE(hw_addrs) || 772 ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) ||
774 IVTV_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 1)) || 773 IVTV_HW_GPIO != (1 << (ARRAY_SIZE(hw_addrs) - 1)) ||
775 hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) { 774 hw_driverids[ARRAY_SIZE(hw_addrs) - 1]) {
776 IVTV_ERR("Mismatched I2C hardware arrays\n"); 775 IVTV_ERR("Mismatched I2C hardware arrays\n");
diff --git a/drivers/media/video/m52790.c b/drivers/media/video/m52790.c
index 5b9dfa2c51b4..8e0160d275ca 100644
--- a/drivers/media/video/m52790.c
+++ b/drivers/media/video/m52790.c
@@ -135,8 +135,6 @@ static int m52790_probe(struct i2c_client *client,
135 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 135 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
136 return -EIO; 136 return -EIO;
137 137
138 snprintf(client->name, sizeof(client->name) - 1, "m52790");
139
140 v4l_info(client, "chip found @ 0x%x (%s)\n", 138 v4l_info(client, "chip found @ 0x%x (%s)\n",
141 client->addr << 1, client->adapter->name); 139 client->addr << 1, client->adapter->name);
142 140
@@ -159,11 +157,18 @@ static int m52790_remove(struct i2c_client *client)
159 157
160/* ----------------------------------------------------------------------- */ 158/* ----------------------------------------------------------------------- */
161 159
160static const struct i2c_device_id m52790_id[] = {
161 { "m52790", 0 },
162 { }
163};
164MODULE_DEVICE_TABLE(i2c, m52790_id);
165
162static struct v4l2_i2c_driver_data v4l2_i2c_data = { 166static struct v4l2_i2c_driver_data v4l2_i2c_data = {
163 .name = "m52790", 167 .name = "m52790",
164 .driverid = I2C_DRIVERID_M52790, 168 .driverid = I2C_DRIVERID_M52790,
165 .command = m52790_command, 169 .command = m52790_command,
166 .probe = m52790_probe, 170 .probe = m52790_probe,
167 .remove = m52790_remove, 171 .remove = m52790_remove,
172 .id_table = m52790_id,
168}; 173};
169 174
diff --git a/drivers/media/video/msp3400-driver.c b/drivers/media/video/msp3400-driver.c
index e6273162e123..310dbaba55ff 100644
--- a/drivers/media/video/msp3400-driver.c
+++ b/drivers/media/video/msp3400-driver.c
@@ -815,7 +815,8 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
815 int msp_product, msp_prod_hi, msp_prod_lo; 815 int msp_product, msp_prod_hi, msp_prod_lo;
816 int msp_rom; 816 int msp_rom;
817 817
818 snprintf(client->name, sizeof(client->name) - 1, "msp3400"); 818 if (!id)
819 strlcpy(client->name, "msp3400", sizeof(client->name));
819 820
820 if (msp_reset(client) == -1) { 821 if (msp_reset(client) == -1) {
821 v4l_dbg(1, msp_debug, client, "msp3400 not found\n"); 822 v4l_dbg(1, msp_debug, client, "msp3400 not found\n");
@@ -864,9 +865,6 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
864 msp_revision = (state->rev1 & 0x0f) + '@'; 865 msp_revision = (state->rev1 & 0x0f) + '@';
865 msp_hard = ((state->rev1 >> 8) & 0xff) + '@'; 866 msp_hard = ((state->rev1 >> 8) & 0xff) + '@';
866 msp_rom = state->rev2 & 0x1f; 867 msp_rom = state->rev2 & 0x1f;
867 snprintf(client->name, sizeof(client->name), "MSP%d4%02d%c-%c%d",
868 msp_family, msp_product,
869 msp_revision, msp_hard, msp_rom);
870 /* Rev B=2, C=3, D=4, G=7 */ 868 /* Rev B=2, C=3, D=4, G=7 */
871 state->ident = msp_family * 10000 + 4000 + msp_product * 10 + 869 state->ident = msp_family * 10000 + 4000 + msp_product * 10 +
872 msp_revision - '@'; 870 msp_revision - '@';
@@ -931,7 +929,9 @@ static int msp_probe(struct i2c_client *client, const struct i2c_device_id *id)
931 } 929 }
932 930
933 /* hello world :-) */ 931 /* hello world :-) */
934 v4l_info(client, "%s found @ 0x%x (%s)\n", client->name, 932 v4l_info(client, "MSP%d4%02d%c-%c%d found @ 0x%x (%s)\n",
933 msp_family, msp_product,
934 msp_revision, msp_hard, msp_rom,
935 client->addr << 1, client->adapter->name); 935 client->addr << 1, client->adapter->name);
936 v4l_info(client, "%s ", client->name); 936 v4l_info(client, "%s ", client->name);
937 if (state->has_nicam && state->has_radio) 937 if (state->has_nicam && state->has_radio)
@@ -987,6 +987,12 @@ static int msp_remove(struct i2c_client *client)
987 987
988/* ----------------------------------------------------------------------- */ 988/* ----------------------------------------------------------------------- */
989 989
990static const struct i2c_device_id msp_id[] = {
991 { "msp3400", 0 },
992 { }
993};
994MODULE_DEVICE_TABLE(i2c, msp_id);
995
990static struct v4l2_i2c_driver_data v4l2_i2c_data = { 996static struct v4l2_i2c_driver_data v4l2_i2c_data = {
991 .name = "msp3400", 997 .name = "msp3400",
992 .driverid = I2C_DRIVERID_MSP3400, 998 .driverid = I2C_DRIVERID_MSP3400,
@@ -995,6 +1001,7 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
995 .remove = msp_remove, 1001 .remove = msp_remove,
996 .suspend = msp_suspend, 1002 .suspend = msp_suspend,
997 .resume = msp_resume, 1003 .resume = msp_resume,
1004 .id_table = msp_id,
998}; 1005};
999 1006
1000 1007
diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c
index e684108637ad..435c083cc542 100644
--- a/drivers/media/video/saa7115.c
+++ b/drivers/media/video/saa7115.c
@@ -1456,14 +1456,13 @@ static int saa7115_probe(struct i2c_client *client,
1456 struct saa711x_state *state; 1456 struct saa711x_state *state;
1457 int i; 1457 int i;
1458 char name[17]; 1458 char name[17];
1459 u8 chip_id; 1459 char chip_id;
1460 int autodetect = !id || id->driver_data == 1;
1460 1461
1461 /* Check if the adapter supports the needed features */ 1462 /* Check if the adapter supports the needed features */
1462 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1463 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
1463 return -EIO; 1464 return -EIO;
1464 1465
1465 snprintf(client->name, sizeof(client->name) - 1, "saa7115");
1466
1467 for (i = 0; i < 0x0f; i++) { 1466 for (i = 0; i < 0x0f; i++) {
1468 saa711x_write(client, 0, i); 1467 saa711x_write(client, 0, i);
1469 name[i] = (saa711x_read(client, 0) & 0x0f) + '0'; 1468 name[i] = (saa711x_read(client, 0) & 0x0f) + '0';
@@ -1472,8 +1471,7 @@ static int saa7115_probe(struct i2c_client *client,
1472 } 1471 }
1473 name[i] = '\0'; 1472 name[i] = '\0';
1474 1473
1475 saa711x_write(client, 0, 5); 1474 chip_id = name[5];
1476 chip_id = saa711x_read(client, 0) & 0x0f;
1477 1475
1478 /* Check whether this chip is part of the saa711x series */ 1476 /* Check whether this chip is part of the saa711x series */
1479 if (memcmp(name, "1f711", 5)) { 1477 if (memcmp(name, "1f711", 5)) {
@@ -1482,8 +1480,14 @@ static int saa7115_probe(struct i2c_client *client,
1482 return -ENODEV; 1480 return -ENODEV;
1483 } 1481 }
1484 1482
1485 snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id); 1483 /* Safety check */
1486 v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, client->addr << 1, client->adapter->name); 1484 if (!autodetect && id->name[6] != chip_id) {
1485 v4l_warn(client, "found saa711%c while %s was expected\n",
1486 chip_id, id->name);
1487 }
1488 snprintf(client->name, sizeof(client->name), "saa711%c", chip_id);
1489 v4l_info(client, "saa711%c found (%s) @ 0x%x (%s)\n", chip_id, name,
1490 client->addr << 1, client->adapter->name);
1487 1491
1488 state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL); 1492 state = kzalloc(sizeof(struct saa711x_state), GFP_KERNEL);
1489 i2c_set_clientdata(client, state); 1493 i2c_set_clientdata(client, state);
@@ -1499,19 +1503,19 @@ static int saa7115_probe(struct i2c_client *client,
1499 state->hue = 0; 1503 state->hue = 0;
1500 state->sat = 64; 1504 state->sat = 64;
1501 switch (chip_id) { 1505 switch (chip_id) {
1502 case 1: 1506 case '1':
1503 state->ident = V4L2_IDENT_SAA7111; 1507 state->ident = V4L2_IDENT_SAA7111;
1504 break; 1508 break;
1505 case 3: 1509 case '3':
1506 state->ident = V4L2_IDENT_SAA7113; 1510 state->ident = V4L2_IDENT_SAA7113;
1507 break; 1511 break;
1508 case 4: 1512 case '4':
1509 state->ident = V4L2_IDENT_SAA7114; 1513 state->ident = V4L2_IDENT_SAA7114;
1510 break; 1514 break;
1511 case 5: 1515 case '5':
1512 state->ident = V4L2_IDENT_SAA7115; 1516 state->ident = V4L2_IDENT_SAA7115;
1513 break; 1517 break;
1514 case 8: 1518 case '8':
1515 state->ident = V4L2_IDENT_SAA7118; 1519 state->ident = V4L2_IDENT_SAA7118;
1516 break; 1520 break;
1517 default: 1521 default:
@@ -1553,6 +1557,17 @@ static int saa7115_remove(struct i2c_client *client)
1553 return 0; 1557 return 0;
1554} 1558}
1555 1559
1560static const struct i2c_device_id saa7115_id[] = {
1561 { "saa711x", 1 }, /* autodetect */
1562 { "saa7111", 0 },
1563 { "saa7113", 0 },
1564 { "saa7114", 0 },
1565 { "saa7115", 0 },
1566 { "saa7118", 0 },
1567 { }
1568};
1569MODULE_DEVICE_TABLE(i2c, saa7115_id);
1570
1556static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1571static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1557 .name = "saa7115", 1572 .name = "saa7115",
1558 .driverid = I2C_DRIVERID_SAA711X, 1573 .driverid = I2C_DRIVERID_SAA711X,
@@ -1560,5 +1575,6 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1560 .probe = saa7115_probe, 1575 .probe = saa7115_probe,
1561 .remove = saa7115_remove, 1576 .remove = saa7115_remove,
1562 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL, 1577 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL,
1578 .id_table = saa7115_id,
1563}; 1579};
1564 1580
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c
index e750cd65c1c3..79d11a658bdf 100644
--- a/drivers/media/video/saa7127.c
+++ b/drivers/media/video/saa7127.c
@@ -672,8 +672,6 @@ static int saa7127_probe(struct i2c_client *client,
672 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 672 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
673 return -EIO; 673 return -EIO;
674 674
675 snprintf(client->name, sizeof(client->name) - 1, "saa7127");
676
677 v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n", 675 v4l_dbg(1, debug, client, "detecting saa7127 client on address 0x%x\n",
678 client->addr << 1); 676 client->addr << 1);
679 677
@@ -741,11 +739,18 @@ static int saa7127_remove(struct i2c_client *client)
741 739
742/* ----------------------------------------------------------------------- */ 740/* ----------------------------------------------------------------------- */
743 741
742static struct i2c_device_id saa7127_id[] = {
743 { "saa7127", 0 },
744 { }
745};
746MODULE_DEVICE_TABLE(i2c, saa7127_id);
747
744static struct v4l2_i2c_driver_data v4l2_i2c_data = { 748static struct v4l2_i2c_driver_data v4l2_i2c_data = {
745 .name = "saa7127", 749 .name = "saa7127",
746 .driverid = I2C_DRIVERID_SAA7127, 750 .driverid = I2C_DRIVERID_SAA7127,
747 .command = saa7127_command, 751 .command = saa7127_command,
748 .probe = saa7127_probe, 752 .probe = saa7127_probe,
749 .remove = saa7127_remove, 753 .remove = saa7127_remove,
754 .id_table = saa7127_id,
750}; 755};
751 756
diff --git a/drivers/media/video/saa717x.c b/drivers/media/video/saa717x.c
index 72c4081feff5..2220f9569941 100644
--- a/drivers/media/video/saa717x.c
+++ b/drivers/media/video/saa717x.c
@@ -1429,8 +1429,6 @@ static int saa717x_probe(struct i2c_client *client,
1429 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1429 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
1430 return -EIO; 1430 return -EIO;
1431 1431
1432 snprintf(client->name, sizeof(client->name) - 1, "saa717x");
1433
1434 if (saa717x_write(client, 0x5a4, 0xfe) && 1432 if (saa717x_write(client, 0x5a4, 0xfe) &&
1435 saa717x_write(client, 0x5a5, 0x0f) && 1433 saa717x_write(client, 0x5a5, 0x0f) &&
1436 saa717x_write(client, 0x5a6, 0x00) && 1434 saa717x_write(client, 0x5a6, 0x00) &&
@@ -1507,6 +1505,12 @@ static int saa717x_remove(struct i2c_client *client)
1507 1505
1508/* ----------------------------------------------------------------------- */ 1506/* ----------------------------------------------------------------------- */
1509 1507
1508static const struct i2c_device_id saa717x_id[] = {
1509 { "saa717x", 0 },
1510 { }
1511};
1512MODULE_DEVICE_TABLE(i2c, saa717x_id);
1513
1510static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1514static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1511 .name = "saa717x", 1515 .name = "saa717x",
1512 .driverid = I2C_DRIVERID_SAA717X, 1516 .driverid = I2C_DRIVERID_SAA717X,
@@ -1514,4 +1518,5 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
1514 .probe = saa717x_probe, 1518 .probe = saa717x_probe,
1515 .remove = saa717x_remove, 1519 .remove = saa717x_remove,
1516 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL, 1520 .legacy_class = I2C_CLASS_TV_ANALOG | I2C_CLASS_TV_DIGITAL,
1521 .id_table = saa717x_id,
1517}; 1522};
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. */
1289static const struct i2c_device_id tuner_id[] = {
1290 { "tuner", }, /* autodetect */
1291 { }
1292};
1293MODULE_DEVICE_TABLE(i2c, tuner_id);
1294
1281static struct v4l2_i2c_driver_data v4l2_i2c_data = { 1295static 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
diff --git a/drivers/media/video/upd64031a.c b/drivers/media/video/upd64031a.c
index 93bfd19dec7d..b4628874933b 100644
--- a/drivers/media/video/upd64031a.c
+++ b/drivers/media/video/upd64031a.c
@@ -228,6 +228,11 @@ static int upd64031a_remove(struct i2c_client *client)
228 228
229/* ----------------------------------------------------------------------- */ 229/* ----------------------------------------------------------------------- */
230 230
231static const struct i2c_device_id upd64031a_id[] = {
232 { "upd64031a", 0 },
233 { }
234};
235MODULE_DEVICE_TABLE(i2c, upd64031a_id);
231 236
232static struct v4l2_i2c_driver_data v4l2_i2c_data = { 237static struct v4l2_i2c_driver_data v4l2_i2c_data = {
233 .name = "upd64031a", 238 .name = "upd64031a",
@@ -235,4 +240,5 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
235 .command = upd64031a_command, 240 .command = upd64031a_command,
236 .probe = upd64031a_probe, 241 .probe = upd64031a_probe,
237 .remove = upd64031a_remove, 242 .remove = upd64031a_remove,
243 .id_table = upd64031a_id,
238}; 244};
diff --git a/drivers/media/video/upd64083.c b/drivers/media/video/upd64083.c
index 9ab712a56ce0..9521ce004dcc 100644
--- a/drivers/media/video/upd64083.c
+++ b/drivers/media/video/upd64083.c
@@ -205,6 +205,11 @@ static int upd64083_remove(struct i2c_client *client)
205 205
206/* ----------------------------------------------------------------------- */ 206/* ----------------------------------------------------------------------- */
207 207
208static const struct i2c_device_id upd64083_id[] = {
209 { "upd64083", 0 },
210 { }
211};
212MODULE_DEVICE_TABLE(i2c, upd64083_id);
208 213
209static struct v4l2_i2c_driver_data v4l2_i2c_data = { 214static struct v4l2_i2c_driver_data v4l2_i2c_data = {
210 .name = "upd64083", 215 .name = "upd64083",
@@ -212,4 +217,5 @@ static struct v4l2_i2c_driver_data v4l2_i2c_data = {
212 .command = upd64083_command, 217 .command = upd64083_command,
213 .probe = upd64083_probe, 218 .probe = upd64083_probe,
214 .remove = upd64083_remove, 219 .remove = upd64083_remove,
220 .id_table = upd64083_id,
215}; 221};
diff --git a/drivers/media/video/vp27smpx.c b/drivers/media/video/vp27smpx.c
index fac0deba24af..a1f76ee032e7 100644
--- a/drivers/media/video/vp27smpx.c
+++ b/drivers/media/video/vp27smpx.c
@@ -130,8 +130,6 @@ static int vp27smpx_probe(struct i2c_client *client,
130 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 130 if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA))
131 return -EIO; 131 return -EIO;
132 132
133 snprintf(client->name, sizeof(client->name) - 1, "vp27smpx");
134
135 v4l_info(client, "chip found @ 0x%x (%s)\n", 133 v4l_info(client, "chip found @ 0x%x (%s)\n",
136 client->addr << 1, client->adapter->name); 134 client->addr << 1, client->adapter->name);
137 135
@@ -154,11 +152,18 @@ static int vp27smpx_remove(struct i2c_client *client)
154 152
155/* ----------------------------------------------------------------------- */ 153/* ----------------------------------------------------------------------- */
156 154
155static const struct i2c_device_id vp27smpx_id[] = {
156 { "vp27smpx", 0 },
157 { }
158};
159MODULE_DEVICE_TABLE(i2c, vp27smpx_id);
160
157static struct v4l2_i2c_driver_data v4l2_i2c_data = { 161static struct v4l2_i2c_driver_data v4l2_i2c_data = {
158 .name = "vp27smpx", 162 .name = "vp27smpx",
159 .driverid = I2C_DRIVERID_VP27SMPX, 163 .driverid = I2C_DRIVERID_VP27SMPX,
160 .command = vp27smpx_command, 164 .command = vp27smpx_command,
161 .probe = vp27smpx_probe, 165 .probe = vp27smpx_probe,
162 .remove = vp27smpx_remove, 166 .remove = vp27smpx_remove,
167 .id_table = vp27smpx_id,
163}; 168};
164 169
diff --git a/drivers/media/video/wm8739.c b/drivers/media/video/wm8739.c
index 0f8ed8461fba..fc50299caa36 100644
--- a/drivers/media/video/wm8739.c
+++ b/drivers/media/video/wm8739.c
@@ -313,11 +313,18 @@ static int wm8739_remove(struct i2c_client *client)
313 return 0; 313 return 0;
314} 314}
315 315
316static const struct i2c_device_id wm8739_id[] = {
317 { "wm8739", 0 },
318 { }
319};
320MODULE_DEVICE_TABLE(i2c, wm8739_id);
321
316static struct v4l2_i2c_driver_data v4l2_i2c_data = { 322static struct v4l2_i2c_driver_data v4l2_i2c_data = {
317 .name = "wm8739", 323 .name = "wm8739",
318 .driverid = I2C_DRIVERID_WM8739, 324 .driverid = I2C_DRIVERID_WM8739,
319 .command = wm8739_command, 325 .command = wm8739_command,
320 .probe = wm8739_probe, 326 .probe = wm8739_probe,
321 .remove = wm8739_remove, 327 .remove = wm8739_remove,
328 .id_table = wm8739_id,
322}; 329};
323 330
diff --git a/drivers/media/video/wm8775.c b/drivers/media/video/wm8775.c
index 67a409e60c46..506378a508b9 100644
--- a/drivers/media/video/wm8775.c
+++ b/drivers/media/video/wm8775.c
@@ -216,11 +216,18 @@ static int wm8775_remove(struct i2c_client *client)
216 return 0; 216 return 0;
217} 217}
218 218
219static const struct i2c_device_id wm8775_id[] = {
220 { "wm8775", 0 },
221 { }
222};
223MODULE_DEVICE_TABLE(i2c, wm8775_id);
224
219static struct v4l2_i2c_driver_data v4l2_i2c_data = { 225static struct v4l2_i2c_driver_data v4l2_i2c_data = {
220 .name = "wm8775", 226 .name = "wm8775",
221 .driverid = I2C_DRIVERID_WM8775, 227 .driverid = I2C_DRIVERID_WM8775,
222 .command = wm8775_command, 228 .command = wm8775_command,
223 .probe = wm8775_probe, 229 .probe = wm8775_probe,
224 .remove = wm8775_remove, 230 .remove = wm8775_remove,
231 .id_table = wm8775_id,
225}; 232};
226 233