From: Laurent Pinchart Date: Fri, 24 Sep 2010 10:37:47 +0000 (-0300) Subject: [media] v4l: Load I2C modules based on modalias X-Git-Tag: v2.6.37-rc1~64^2~41 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e9f0495a25e37a3bc60c42fbfe3b31a47b91b7ad;p=linux.git [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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index cef80dab1a0d..9294282b5add 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, if (module_name) request_module(module_name); + else + request_module(I2C_MODULE_PREFIX "%s", info->type); /* Create the i2c client */ if (info->addr == 0 && probe_addrs)