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/ivtv | |
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/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-i2c.c | 13 |
1 files changed, 6 insertions, 7 deletions
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 */ |
139 | static const char * const hw_drivernames[] = { | 139 | static 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"); |