aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-i2c.c
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 /drivers/media/video/cx18/cx18-i2c.c
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>
Diffstat (limited to 'drivers/media/video/cx18/cx18-i2c.c')
-rw-r--r--drivers/media/video/cx18/cx18-i2c.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 4f08a4058d1..1d6c51a7531 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