aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-09-24 06:37:47 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2010-10-22 19:34:17 -0400
commite9f0495a25e37a3bc60c42fbfe3b31a47b91b7ad (patch)
treee1c7e607f110157bf209bd34b2d132c38d6e7176 /drivers/media/video
parentb8383962c388288b99bcaadcf8a87b049cd56d4a (diff)
[media] v4l: Load I2C modules based on modalias
When creating a new sub-device, The V4L I2C subdev API has historically required drivers to pass the name of the module that implements support for the I2C device. I2C modules can be loaded based on modaliases instead of the module name. As the I2C device type name is already available to the v4l2_i2c_new_subdev* functions, make the module name argument optional and create a modalias based on the type name when no module name is provided. All in-tree drivers call those functions with a non-NULL module name argument, this change is thus harmless. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/v4l2-common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index cef80dab1a0..9294282b5ad 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -378,6 +378,8 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
378 378
379 if (module_name) 379 if (module_name)
380 request_module(module_name); 380 request_module(module_name);
381 else
382 request_module(I2C_MODULE_PREFIX "%s", info->type);
381 383
382 /* Create the i2c client */ 384 /* Create the i2c client */
383 if (info->addr == 0 && probe_addrs) 385 if (info->addr == 0 && probe_addrs)