aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-09-24 07:11:59 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-22 19:52:04 -0400
commit50fbc5a463d48525eca9b4cb78d7ad4818d39532 (patch)
treee8cf84b39c4a24d0471e5d1ee490808c0f68f5b8 /drivers
parent0e32ee12fbe3fdef23c4a2c8bb135d309f67ebed (diff)
[media] go7007: Don't use module names to load I2C modules
With the v4l2_i2c_new_subdev* functions now supporting loading modules based on modaliases, replace the hardcoded module name passed to those functions by NULL. All corresponding I2C modules have been checked, and all of them include a module aliases table with names corresponding to what the go7007 driver uses. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/go7007/go7007-driver.c43
1 files changed, 3 insertions, 40 deletions
diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
index b8ecbd889761..b3f42f37a313 100644
--- a/drivers/staging/go7007/go7007-driver.c
+++ b/drivers/staging/go7007/go7007-driver.c
@@ -194,51 +194,15 @@ int go7007_reset_encoder(struct go7007 *go)
194 * Attempt to instantiate an I2C client by ID, probably loading a module. 194 * Attempt to instantiate an I2C client by ID, probably loading a module.
195 */ 195 */
196static int init_i2c_module(struct i2c_adapter *adapter, const char *type, 196static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
197 int id, int addr) 197 int addr)
198{ 198{
199 struct go7007 *go = i2c_get_adapdata(adapter); 199 struct go7007 *go = i2c_get_adapdata(adapter);
200 struct v4l2_device *v4l2_dev = &go->v4l2_dev; 200 struct v4l2_device *v4l2_dev = &go->v4l2_dev;
201 char *modname;
202 201
203 switch (id) { 202 if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL))
204 case I2C_DRIVERID_WIS_SAA7115:
205 modname = "wis-saa7115";
206 break;
207 case I2C_DRIVERID_WIS_SAA7113:
208 modname = "wis-saa7113";
209 break;
210 case I2C_DRIVERID_WIS_UDA1342:
211 modname = "wis-uda1342";
212 break;
213 case I2C_DRIVERID_WIS_SONY_TUNER:
214 modname = "wis-sony-tuner";
215 break;
216 case I2C_DRIVERID_WIS_TW9903:
217 modname = "wis-tw9903";
218 break;
219 case I2C_DRIVERID_WIS_TW2804:
220 modname = "wis-tw2804";
221 break;
222 case I2C_DRIVERID_WIS_OV7640:
223 modname = "wis-ov7640";
224 break;
225 case I2C_DRIVERID_S2250:
226 modname = "s2250";
227 break;
228 default:
229 modname = NULL;
230 break;
231 }
232
233 if (v4l2_i2c_new_subdev(v4l2_dev, adapter, modname, type, addr, NULL))
234 return 0; 203 return 0;
235 204
236 if (modname != NULL) 205 printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
237 printk(KERN_INFO
238 "go7007: probing for module %s failed\n", modname);
239 else
240 printk(KERN_INFO
241 "go7007: sensor %u seems to be unsupported!\n", id);
242 return -1; 206 return -1;
243} 207}
244 208
@@ -277,7 +241,6 @@ int go7007_register_encoder(struct go7007 *go)
277 for (i = 0; i < go->board_info->num_i2c_devs; ++i) 241 for (i = 0; i < go->board_info->num_i2c_devs; ++i)
278 init_i2c_module(&go->i2c_adapter, 242 init_i2c_module(&go->i2c_adapter,
279 go->board_info->i2c_devs[i].type, 243 go->board_info->i2c_devs[i].type,
280 go->board_info->i2c_devs[i].id,
281 go->board_info->i2c_devs[i].addr); 244 go->board_info->i2c_devs[i].addr);
282 if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) 245 if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
283 i2c_clients_command(&go->i2c_adapter, 246 i2c_clients_command(&go->i2c_adapter,