public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/16] Use modaliases to load I2C modules - please review
@ 2010-09-24 14:13 Laurent Pinchart
  2010-09-24 14:13 ` [PATCH 01/16] v4l: Load I2C modules based on modalias Laurent Pinchart
                   ` (16 more replies)
  0 siblings, 17 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:13 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

Hi everybody,

Here's a bunch of patches (on top of staging/v2.6.37) that remove the
module_name argument to the v4l2_i2c_new_subdev* functions.

The module name is used by those functions to load the module corresponding
to the I2C sub-device being instanciated. As the I2C modules now support
modalias (and have been for quite some time), the module name isn't necessary
anymore.

The first patch adds the ability to load I2C modules based on modaliases when
the module name passed to the v4l_i2c_new_subdev* functions is NULL. This is
never the case with the in-tree drivers, so there shouldn't be any regression.

The 14 next patches modify all drivers that call those functions to pass a NULL
module name. Patch 2/16 touches all the drivers that hardcode the module name
directly when calling the function, and the remaining 13 patches do the same
for driver that fetch the module name from platform data or from other sources
(such as static tables). I've checked all I2C modules used by the drivers
modified in those patches to make sure they have a proper module devices table.

The last patch finally removes the module_name argument, as all callers now
pass a NULL value.

The code has obviously not been tested, as I lack the necessary hardware. I've
tested the V4L2 core changes with the OMAP3 ISP driver. All x86 drivers have
been compile-tested.

Laurent Pinchart (16):
  v4l: Load I2C modules based on modalias
  v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*
  go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules
  go7007: Fix the TW2804 I2C type name
  go7007: Don't use module names to load I2C modules
  zoran: Don't use module names to load I2C modules
  pvrusb2: Don't use module names to load I2C modules
  sh_vou: Don't use module names to load I2C modules
  radio-si4713: Don't use module names to load I2C modules
  soc_camera: Don't use module names to load I2C modules
  vpfe_capture: Don't use module names to load I2C modules
  vpif_display: Don't use module names to load I2C modules
  vpif_capture: Don't use module names to load I2C modules
  ivtv: Don't use module names to load I2C modules
  cx18: Don't use module names to load I2C modules
  v4l: Remove module_name argument to the v4l2_i2c_new_subdev*
    functions

 arch/arm/mach-mx3/mach-pcm037.c               |    2 -
 arch/arm/mach-mx3/mx31moboard-marxbot.c       |    1 -
 arch/arm/mach-mx3/mx31moboard-smartbot.c      |    1 -
 arch/arm/mach-pxa/em-x270.c                   |    1 -
 arch/arm/mach-pxa/ezx.c                       |    2 -
 arch/arm/mach-pxa/mioa701.c                   |    1 -
 arch/arm/mach-pxa/pcm990-baseboard.c          |    2 -
 arch/sh/boards/mach-ap325rxa/setup.c          |    1 -
 arch/sh/boards/mach-ecovec24/setup.c          |    4 --
 arch/sh/boards/mach-kfr2r09/setup.c           |    1 -
 arch/sh/boards/mach-migor/setup.c             |    2 -
 arch/sh/boards/mach-se/7724/setup.c           |    1 -
 drivers/media/radio/radio-si4713.c            |    2 +-
 drivers/media/video/au0828/au0828-cards.c     |    4 +-
 drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++-----
 drivers/media/video/cafe_ccic.c               |    2 +-
 drivers/media/video/cx18/cx18-i2c.c           |   22 ++---------
 drivers/media/video/cx231xx/cx231xx-cards.c   |    4 +-
 drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
 drivers/media/video/cx23885/cx23885-video.c   |    4 +-
 drivers/media/video/cx88/cx88-cards.c         |    9 ++--
 drivers/media/video/cx88/cx88-video.c         |    7 +--
 drivers/media/video/davinci/vpfe_capture.c    |    1 -
 drivers/media/video/davinci/vpif_capture.c    |    1 -
 drivers/media/video/davinci/vpif_display.c    |    2 +-
 drivers/media/video/em28xx/em28xx-cards.c     |   18 ++++----
 drivers/media/video/fsl-viu.c                 |    2 +-
 drivers/media/video/ivtv/ivtv-i2c.c           |   50 +++++--------------------
 drivers/media/video/mxb.c                     |   12 +++---
 drivers/media/video/pvrusb2/pvrusb2-hdw.c     |   13 +-----
 drivers/media/video/saa7134/saa7134-cards.c   |    8 ++--
 drivers/media/video/saa7134/saa7134-core.c    |    4 +-
 drivers/media/video/sh_vou.c                  |    2 +-
 drivers/media/video/soc_camera.c              |    2 +-
 drivers/media/video/usbvision/usbvision-i2c.c |    6 +-
 drivers/media/video/v4l2-common.c             |   13 ++----
 drivers/media/video/vino.c                    |    4 +-
 drivers/media/video/zoran/zoran.h             |    2 -
 drivers/media/video/zoran/zoran_card.c        |   24 +----------
 drivers/staging/go7007/go7007-driver.c        |   43 +--------------------
 drivers/staging/go7007/go7007-usb.c           |    2 +-
 drivers/staging/go7007/wis-ov7640.c           |    1 +
 drivers/staging/go7007/wis-saa7113.c          |    1 +
 drivers/staging/go7007/wis-saa7115.c          |    1 +
 drivers/staging/go7007/wis-sony-tuner.c       |    1 +
 drivers/staging/go7007/wis-tw2804.c           |    1 +
 drivers/staging/go7007/wis-tw9903.c           |    1 +
 drivers/staging/go7007/wis-uda1342.c          |    1 +
 drivers/staging/tm6000/tm6000-cards.c         |    4 +-
 include/media/sh_vou.h                        |    1 -
 include/media/v4l2-common.h                   |   16 +++-----
 51 files changed, 100 insertions(+), 234 deletions(-)

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [PATCH 01/16] v4l: Load I2C modules based on modalias
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
@ 2010-09-24 14:13 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 02/16] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev* Laurent Pinchart
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:13 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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>
---
 drivers/media/video/v4l2-common.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 3ce7c64..120b4ac 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)
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 02/16] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
  2010-09-24 14:13 ` [PATCH 01/16] v4l: Load I2C modules based on modalias Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules Laurent Pinchart
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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 drivers
modified here use.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/au0828/au0828-cards.c     |    4 ++--
 drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++++++++-----------
 drivers/media/video/cafe_ccic.c               |    2 +-
 drivers/media/video/cx231xx/cx231xx-cards.c   |    4 ++--
 drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
 drivers/media/video/cx23885/cx23885-video.c   |    6 +++---
 drivers/media/video/cx88/cx88-cards.c         |    8 ++++----
 drivers/media/video/cx88/cx88-video.c         |    4 ++--
 drivers/media/video/em28xx/em28xx-cards.c     |   18 +++++++++---------
 drivers/media/video/fsl-viu.c                 |    2 +-
 drivers/media/video/mxb.c                     |   12 ++++++------
 drivers/media/video/saa7134/saa7134-cards.c   |    8 ++++----
 drivers/media/video/saa7134/saa7134-core.c    |    4 ++--
 drivers/media/video/usbvision/usbvision-i2c.c |    6 +++---
 drivers/media/video/vino.c                    |    4 ++--
 drivers/staging/tm6000/tm6000-cards.c         |    4 ++--
 16 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
index 57dd919..0453816 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -212,7 +212,7 @@ void au0828_card_setup(struct au0828_dev *dev)
 		   be abstracted out if we ever need to support a different
 		   demod) */
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				"au8522", "au8522", 0x8e >> 1, NULL);
+				NULL, "au8522", 0x8e >> 1, NULL);
 		if (sd == NULL)
 			printk(KERN_ERR "analog subdev registration failed\n");
 	}
@@ -221,7 +221,7 @@ void au0828_card_setup(struct au0828_dev *dev)
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		/* Load the tuner module, which does the attach */
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				"tuner", "tuner", dev->board.tuner_addr, NULL);
+				NULL, "tuner", dev->board.tuner_addr, NULL);
 		if (sd == NULL)
 			printk(KERN_ERR "tuner subdev registration fail\n");
 
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 7af56cd..87d8b00 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3529,7 +3529,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, "saa6588", "saa6588", 0, addrs);
+			&btv->c.i2c_adap, NULL, "saa6588", 0, addrs);
 		btv->has_saa6588 = (sd != NULL);
 	}
 
@@ -3554,7 +3554,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, "msp3400", "msp3400", 0, addrs);
+			&btv->c.i2c_adap, NULL, "msp3400", 0, addrs);
 		if (btv->sd_msp34xx)
 			return;
 		goto no_audio;
@@ -3568,7 +3568,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, "tda7432", "tda7432", 0, addrs))
+				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
 			return;
 		goto no_audio;
 	}
@@ -3576,7 +3576,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 	case 3: {
 		/* The user specified that we should probe for tvaudio */
 		btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, "tvaudio", "tvaudio", 0, tvaudio_addrs());
+			&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
 		if (btv->sd_tvaudio)
 			return;
 		goto no_audio;
@@ -3596,11 +3596,11 @@ void __devinit bttv_init_card2(struct bttv *btv)
 	   found is really something else (e.g. a tea6300). */
 	if (!bttv_tvcards[btv->c.type].no_msp34xx) {
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, "msp3400", "msp3400",
+			&btv->c.i2c_adap, NULL, "msp3400",
 			0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
 	} else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, "msp3400", "msp3400",
+			&btv->c.i2c_adap, NULL, "msp3400",
 			0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
 	}
 
@@ -3616,13 +3616,13 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, "tda7432", "tda7432", 0, addrs))
+				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
 			return;
 	}
 
 	/* Now see if we can find one of the tvaudio devices. */
 	btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-		&btv->c.i2c_adap, "tvaudio", "tvaudio", 0, tvaudio_addrs());
+		&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
 	if (btv->sd_tvaudio)
 		return;
 
@@ -3646,13 +3646,13 @@ void __devinit bttv_init_tuner(struct bttv *btv)
 		/* Load tuner module before issuing tuner config call! */
 		if (bttv_tvcards[btv->c.type].has_radio)
 			v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, "tuner", "tuner",
+				&btv->c.i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
 		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, "tuner", "tuner",
+				&btv->c.i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, "tuner", "tuner",
+				&btv->c.i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
 
 		tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 2ffb6df..780f3ff 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2014,7 +2014,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 
 	cam->sensor_addr = 0x42;
 	cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, &cam->i2c_adapter,
-			"ov7670", "ov7670", cam->sensor_addr, NULL);
+			NULL, "ov7670", cam->sensor_addr, NULL);
 	if (cam->sensor == NULL) {
 		ret = -ENODEV;
 		goto out_smbus;
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index f2a4900..daaa3b4 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -319,7 +319,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
 	if (dev->board.decoder == CX231XX_AVDECODER) {
 		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 					&dev->i2c_bus[0].i2c_adap,
-					"cx25840", "cx25840", 0x88 >> 1, NULL);
+					NULL, "cx25840", 0x88 >> 1, NULL);
 		if (dev->sd_cx25840 == NULL)
 			cx231xx_info("cx25840 subdev registration failure\n");
 		cx25840_call(dev, core, load_fw);
@@ -329,7 +329,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		dev->sd_tuner =	v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[1].i2c_adap,
-				"tuner", "tuner", 0xc2 >> 1, NULL);
+				NULL, "tuner", 0xc2 >> 1, NULL);
 		if (dev->sd_tuner == NULL)
 			cx231xx_info("tuner subdev registration failure\n");
 
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index e76ce87..db05400 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -1247,7 +1247,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
 	case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200:
 		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[2].i2c_adap,
-				"cx25840", "cx25840", 0x88 >> 1, NULL);
+				NULL, "cx25840", 0x88 >> 1, NULL);
 		if (dev->sd_cx25840) {
 			dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE;
 			v4l2_subdev_call(dev->sd_cx25840, core, load_fw);
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 5aadc1d..4920ddd 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -1512,11 +1512,11 @@ int cx23885_video_register(struct cx23885_dev *dev)
 		if (dev->tuner_addr)
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[1].i2c_adap,
-				"tuner", "tuner", dev->tuner_addr, NULL);
+				NULL, "tuner", dev->tuner_addr, NULL);
 		else
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_bus[1].i2c_adap,
-				"tuner", "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV));
+				&dev->i2c_bus[1].i2c_adap, NULL,
+				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV));
 		if (sd) {
 			struct tuner_setup tun_setup;
 
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index 97672cb..b0613f7 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -3485,19 +3485,19 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
 		   later code configures a tea5767.
 		 */
 		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				"tuner", "tuner",
+				NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
 		if (has_demod)
 			v4l2_i2c_new_subdev(&core->v4l2_dev,
-				&core->i2c_adap, "tuner", "tuner",
+				&core->i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (core->board.tuner_addr == ADDR_UNSET) {
 			v4l2_i2c_new_subdev(&core->v4l2_dev,
-				&core->i2c_adap, "tuner", "tuner",
+				&core->i2c_adap, NULL, "tuner",
 				0, has_demod ? tv_addrs + 4 : tv_addrs);
 		} else {
 			v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				"tuner", "tuner", core->board.tuner_addr, NULL);
+				NULL, "tuner", core->board.tuner_addr, NULL);
 		}
 	}
 
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index b755bf1..f9d1877 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1873,14 +1873,14 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 
 	if (core->board.audio_chip == V4L2_IDENT_WM8775)
 		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				"wm8775", "wm8775", 0x36 >> 1, NULL);
+				NULL, "wm8775", 0x36 >> 1, NULL);
 
 	if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) {
 		/* This probes for a tda9874 as is used on some
 		   Pixelview Ultra boards. */
 		v4l2_i2c_new_subdev(&core->v4l2_dev,
 				&core->i2c_adap,
-				"tvaudio", "tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
+				NULL, "tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
 	}
 
 	switch (core->boardnr) {
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index ffbe544..7af7860 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2523,39 +2523,39 @@ void em28xx_card_setup(struct em28xx *dev)
 	/* request some modules */
 	if (dev->board.has_msp34xx)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			"msp3400", "msp3400", 0, msp3400_addrs);
+			NULL, "msp3400", 0, msp3400_addrs);
 
 	if (dev->board.decoder == EM28XX_SAA711X)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			"saa7115", "saa7115_auto", 0, saa711x_addrs);
+			NULL, "saa7115_auto", 0, saa711x_addrs);
 
 	if (dev->board.decoder == EM28XX_TVP5150)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			"tvp5150", "tvp5150", 0, tvp5150_addrs);
+			NULL, "tvp5150", 0, tvp5150_addrs);
 
 	if (dev->em28xx_sensor == EM28XX_MT9V011) {
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-			 &dev->i2c_adap, "mt9v011", "mt9v011", 0, mt9v011_addrs);
+			 &dev->i2c_adap, NULL, "mt9v011", 0, mt9v011_addrs);
 		v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
 	}
 
 
 	if (dev->board.adecoder == EM28XX_TVAUDIO)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			"tvaudio", "tvaudio", dev->board.tvaudio_addr, NULL);
+			NULL, "tvaudio", dev->board.tvaudio_addr, NULL);
 
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
 
 		if (dev->board.radio.type)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				"tuner", "tuner", dev->board.radio_addr, NULL);
+				NULL, "tuner", dev->board.radio_addr, NULL);
 
 		if (has_demod)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (dev->tuner_addr == 0) {
 			enum v4l2_i2c_tuner_type type =
@@ -2563,14 +2563,14 @@ void em28xx_card_setup(struct em28xx *dev)
 			struct v4l2_subdev *sd;
 
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(type));
 
 			if (sd)
 				dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
 		} else {
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				"tuner", "tuner", dev->tuner_addr, NULL);
+				NULL, "tuner", dev->tuner_addr, NULL);
 		}
 	}
 
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c
index 8f1c94f..e7f63c1 100644
--- a/drivers/media/video/fsl-viu.c
+++ b/drivers/media/video/fsl-viu.c
@@ -1485,7 +1485,7 @@ static int __devinit viu_of_probe(struct of_device *op,
 
 	ad = i2c_get_adapter(0);
 	viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad,
-			"saa7115", "saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
+			NULL, "saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
 
 	viu_dev->vidq.timeout.function = viu_vid_timeout;
 	viu_dev->vidq.timeout.data     = (unsigned long)viu_dev;
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index da07d14..4c9c1bb 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -185,17 +185,17 @@ static int mxb_probe(struct saa7146_dev *dev)
 	}
 
 	mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"saa7115", "saa7111", I2C_SAA7111A, NULL);
+			NULL, "saa7111", I2C_SAA7111A, NULL);
 	mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"tea6420", "tea6420", I2C_TEA6420_1, NULL);
+			NULL, "tea6420", I2C_TEA6420_1, NULL);
 	mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"tea6420", "tea6420", I2C_TEA6420_2, NULL);
+			NULL, "tea6420", I2C_TEA6420_2, NULL);
 	mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"tea6415c", "tea6415c", I2C_TEA6415C, NULL);
+			NULL, "tea6415c", I2C_TEA6415C, NULL);
 	mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"tda9840", "tda9840", I2C_TDA9840, NULL);
+			NULL, "tda9840", I2C_TDA9840, NULL);
 	mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			"tuner", "tuner", I2C_TUNER, NULL);
+			NULL, "tuner", I2C_TUNER, NULL);
 
 	/* check if all devices are present */
 	if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index bb8d83d..10a6cbf 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -7551,22 +7551,22 @@ int saa7134_board_init2(struct saa7134_dev *dev)
 		   so we do not need to probe for a radio tuner device. */
 		if (dev->radio_type != UNSET)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				dev->radio_addr, NULL);
 		if (has_demod)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (dev->tuner_addr == ADDR_UNSET) {
 			enum v4l2_i2c_tuner_type type =
 				has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
 
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				0, v4l2_i2c_tuner_addrs(type));
 		} else {
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, "tuner", "tuner",
+				&dev->i2c_adap, NULL, "tuner",
 				dev->tuner_addr, NULL);
 		}
 	}
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 40bc635..2de110f 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -991,7 +991,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 	if (card_is_empress(dev)) {
 		struct v4l2_subdev *sd =
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				"saa6752hs", "saa6752hs",
+				NULL, "saa6752hs",
 				saa7134_boards[dev->board].empress_addr, NULL);
 
 		if (sd)
@@ -1002,7 +1002,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap,	"saa6588", "saa6588",
+				&dev->i2c_adap, NULL, "saa6588",
 				0, I2C_ADDRS(saa7134_boards[dev->board].rds_addr));
 		if (sd) {
 			printk(KERN_INFO "%s: found RDS decoder\n", dev->name);
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index a5fd2aa..e3bbae2 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -251,7 +251,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
 		   hit-and-miss. */
 		mdelay(10);
 		v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, "saa7115",
+				&usbvision->i2c_adap, NULL,
 				"saa7115_auto", 0, saa711x_addrs);
 		break;
 	}
@@ -261,14 +261,14 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
 		struct tuner_setup tun_setup;
 
 		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, "tuner",
+				&usbvision->i2c_adap, NULL,
 				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		/* depending on whether we found a demod or not, select
 		   the tuner type. */
 		type = sd ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
 
 		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, "tuner",
+				&usbvision->i2c_adap, NULL,
 				"tuner", 0, v4l2_i2c_tuner_addrs(type));
 
 		if (sd == NULL)
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index 3eb15f7..e5e005d 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -4334,10 +4334,10 @@ static int __init vino_module_init(void)
 
 	vino_drvdata->decoder =
 		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
-			       "saa7191", "saa7191", 0, I2C_ADDRS(0x45));
+			       NULL, "saa7191", 0, I2C_ADDRS(0x45));
 	vino_drvdata->camera =
 		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
-			       "indycam", "indycam", 0, I2C_ADDRS(0x2b));
+			       NULL, "indycam", 0, I2C_ADDRS(0x2b));
 
 	dprintk("init complete!\n");
 
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c
index 9d091c3..1c3b1b6 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -545,7 +545,7 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
 
 	/* Load tuner module */
 	v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-		"tuner", "tuner", dev->tuner_addr, NULL);
+		NULL, "tuner", dev->tuner_addr, NULL);
 
 	memset(&tun_setup, 0, sizeof(tun_setup));
 	tun_setup.type = dev->tuner_type;
@@ -683,7 +683,7 @@ static int tm6000_init_dev(struct tm6000_core *dev)
 
 	if (dev->caps.has_tda9874)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			"tvaudio", "tvaudio", I2C_ADDR_TDA9874, NULL);
+			NULL, "tvaudio", I2C_ADDR_TDA9874, NULL);
 
 	/* register and initialize V4L2 */
 	rc = tm6000_v4l2_register(dev);
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
  2010-09-24 14:13 ` [PATCH 01/16] v4l: Load I2C modules based on modalias Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 02/16] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev* Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-10-07 16:33   ` Pete Eberlein
  2010-09-24 14:14 ` [PATCH 04/16] go7007: Fix the TW2804 I2C type name Laurent Pinchart
                   ` (13 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

The device table is required to load modules based on modaliases.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/go7007/wis-ov7640.c     |    1 +
 drivers/staging/go7007/wis-saa7113.c    |    1 +
 drivers/staging/go7007/wis-saa7115.c    |    1 +
 drivers/staging/go7007/wis-sony-tuner.c |    1 +
 drivers/staging/go7007/wis-tw2804.c     |    1 +
 drivers/staging/go7007/wis-tw9903.c     |    1 +
 drivers/staging/go7007/wis-uda1342.c    |    1 +
 7 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/go7007/wis-ov7640.c b/drivers/staging/go7007/wis-ov7640.c
index 4f0cbdd..6bc9470 100644
--- a/drivers/staging/go7007/wis-ov7640.c
+++ b/drivers/staging/go7007/wis-ov7640.c
@@ -81,6 +81,7 @@ static const struct i2c_device_id wis_ov7640_id[] = {
 	{ "wis_ov7640", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_ov7640_id);
 
 static struct i2c_driver wis_ov7640_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-saa7113.c b/drivers/staging/go7007/wis-saa7113.c
index 72f5c1f..05e0e10 100644
--- a/drivers/staging/go7007/wis-saa7113.c
+++ b/drivers/staging/go7007/wis-saa7113.c
@@ -308,6 +308,7 @@ static const struct i2c_device_id wis_saa7113_id[] = {
 	{ "wis_saa7113", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_saa7113_id);
 
 static struct i2c_driver wis_saa7113_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-saa7115.c b/drivers/staging/go7007/wis-saa7115.c
index cd950b6..46cff59 100644
--- a/drivers/staging/go7007/wis-saa7115.c
+++ b/drivers/staging/go7007/wis-saa7115.c
@@ -441,6 +441,7 @@ static const struct i2c_device_id wis_saa7115_id[] = {
 	{ "wis_saa7115", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_saa7115_id);
 
 static struct i2c_driver wis_saa7115_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-sony-tuner.c b/drivers/staging/go7007/wis-sony-tuner.c
index 981c9b3..8f1b7d4 100644
--- a/drivers/staging/go7007/wis-sony-tuner.c
+++ b/drivers/staging/go7007/wis-sony-tuner.c
@@ -692,6 +692,7 @@ static const struct i2c_device_id wis_sony_tuner_id[] = {
 	{ "wis_sony_tuner", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_sony_tuner_id);
 
 static struct i2c_driver wis_sony_tuner_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-tw2804.c b/drivers/staging/go7007/wis-tw2804.c
index ee28a99..5b218c5 100644
--- a/drivers/staging/go7007/wis-tw2804.c
+++ b/drivers/staging/go7007/wis-tw2804.c
@@ -331,6 +331,7 @@ static const struct i2c_device_id wis_tw2804_id[] = {
 	{ "wis_tw2804", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_tw2804_id);
 
 static struct i2c_driver wis_tw2804_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-tw9903.c b/drivers/staging/go7007/wis-tw9903.c
index 80d4726..9230f4a 100644
--- a/drivers/staging/go7007/wis-tw9903.c
+++ b/drivers/staging/go7007/wis-tw9903.c
@@ -313,6 +313,7 @@ static const struct i2c_device_id wis_tw9903_id[] = {
 	{ "wis_tw9903", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_tw9903_id);
 
 static struct i2c_driver wis_tw9903_driver = {
 	.driver = {
diff --git a/drivers/staging/go7007/wis-uda1342.c b/drivers/staging/go7007/wis-uda1342.c
index 5c4eb49..0127be2 100644
--- a/drivers/staging/go7007/wis-uda1342.c
+++ b/drivers/staging/go7007/wis-uda1342.c
@@ -86,6 +86,7 @@ static const struct i2c_device_id wis_uda1342_id[] = {
 	{ "wis_uda1342", 0 },
 	{ }
 };
+MODULE_DEVICE_TABLE(i2c, wis_uda1342_id);
 
 static struct i2c_driver wis_uda1342_driver = {
 	.driver = {
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 04/16] go7007: Fix the TW2804 I2C type name
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (2 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-10-07 16:33   ` Pete Eberlein
  2010-09-24 14:14 ` [PATCH 05/16] go7007: Don't use module names to load I2C modules Laurent Pinchart
                   ` (12 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

The TW2804 I2C sub-device type name was incorrectly set to wis_twTW2804
for the adlink mpg24 board. Rename it to wis_tw2804.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/go7007/go7007-usb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/staging/go7007/go7007-usb.c b/drivers/staging/go7007/go7007-usb.c
index 20ed930..bea9f4d 100644
--- a/drivers/staging/go7007/go7007-usb.c
+++ b/drivers/staging/go7007/go7007-usb.c
@@ -394,7 +394,7 @@ static struct go7007_usb_board board_adlink_mpg24 = {
 		.num_i2c_devs	 = 1,
 		.i2c_devs	 = {
 			{
-				.type	= "wis_twTW2804",
+				.type	= "wis_tw2804",
 				.id	= I2C_DRIVERID_WIS_TW2804,
 				.addr	= 0x00, /* yes, really */
 			},
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 05/16] go7007: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (3 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 04/16] go7007: Fix the TW2804 I2C type name Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-10-07 16:33   ` Pete Eberlein
  2010-09-24 14:14 ` [PATCH 06/16] zoran: " Laurent Pinchart
                   ` (11 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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>
---
 drivers/staging/go7007/go7007-driver.c |   43 ++-----------------------------
 1 files changed, 3 insertions(+), 40 deletions(-)

diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
index 372a7c6..0a1d925 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)
  * Attempt to instantiate an I2C client by ID, probably loading a module.
  */
 static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
-			   int id, int addr)
+			   int addr)
 {
 	struct go7007 *go = i2c_get_adapdata(adapter);
 	struct v4l2_device *v4l2_dev = &go->v4l2_dev;
-	char *modname;
 
-	switch (id) {
-	case I2C_DRIVERID_WIS_SAA7115:
-		modname = "wis-saa7115";
-		break;
-	case I2C_DRIVERID_WIS_SAA7113:
-		modname = "wis-saa7113";
-		break;
-	case I2C_DRIVERID_WIS_UDA1342:
-		modname = "wis-uda1342";
-		break;
-	case I2C_DRIVERID_WIS_SONY_TUNER:
-		modname = "wis-sony-tuner";
-		break;
-	case I2C_DRIVERID_WIS_TW9903:
-		modname = "wis-tw9903";
-		break;
-	case I2C_DRIVERID_WIS_TW2804:
-		modname = "wis-tw2804";
-		break;
-	case I2C_DRIVERID_WIS_OV7640:
-		modname = "wis-ov7640";
-		break;
-	case I2C_DRIVERID_S2250:
-		modname = "s2250";
-		break;
-	default:
-		modname = NULL;
-		break;
-	}
-
-	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, modname, type, addr, NULL))
+	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL))
 		return 0;
 
-	if (modname != NULL)
-		printk(KERN_INFO
-			"go7007: probing for module %s failed\n", modname);
-	else
-		printk(KERN_INFO
-			"go7007: sensor %u seems to be unsupported!\n", id);
+	printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
 	return -1;
 }
 
@@ -277,7 +241,6 @@ int go7007_register_encoder(struct go7007 *go)
 		for (i = 0; i < go->board_info->num_i2c_devs; ++i)
 			init_i2c_module(&go->i2c_adapter,
 					go->board_info->i2c_devs[i].type,
-					go->board_info->i2c_devs[i].id,
 					go->board_info->i2c_devs[i].addr);
 		if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
 			i2c_clients_command(&go->i2c_adapter,
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 06/16] zoran: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (4 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 05/16] go7007: Don't use module names to load I2C modules Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 07/16] pvrusb2: " Laurent Pinchart
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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 zoran driver
uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/zoran/zoran.h      |    2 --
 drivers/media/video/zoran/zoran_card.c |   23 +++--------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/drivers/media/video/zoran/zoran.h b/drivers/media/video/zoran/zoran.h
index 307e847..37fe161 100644
--- a/drivers/media/video/zoran/zoran.h
+++ b/drivers/media/video/zoran/zoran.h
@@ -341,10 +341,8 @@ struct card_info {
 	enum card_type type;
 	char name[32];
 	const char *i2c_decoder;	/* i2c decoder device */
-	const char *mod_decoder;	/* i2c decoder module */
 	const unsigned short *addrs_decoder;
 	const char *i2c_encoder;	/* i2c encoder device */
-	const char *mod_encoder;	/* i2c encoder module */
 	const unsigned short *addrs_encoder;
 	u16 video_vfe, video_codec;			/* videocodec types */
 	u16 audio_chip;					/* audio type */
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c
index bfcd3ae..0aac376 100644
--- a/drivers/media/video/zoran/zoran_card.c
+++ b/drivers/media/video/zoran/zoran_card.c
@@ -379,7 +379,6 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = DC10_old,
 		.name = "DC10(old)",
 		.i2c_decoder = "vpx3220a",
-		.mod_decoder = "vpx3220",
 		.addrs_decoder = vpx3220_addrs,
 		.video_codec = CODEC_TYPE_ZR36050,
 		.video_vfe = CODEC_TYPE_ZR36016,
@@ -409,10 +408,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = DC10_new,
 		.name = "DC10(new)",
 		.i2c_decoder = "saa7110",
-		.mod_decoder = "saa7110",
 		.addrs_decoder = saa7110_addrs,
 		.i2c_encoder = "adv7175",
-		.mod_encoder = "adv7175",
 		.addrs_encoder = adv717x_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -440,10 +437,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = DC10plus,
 		.name = "DC10plus",
 		.i2c_decoder = "saa7110",
-		.mod_decoder = "saa7110",
 		.addrs_decoder = saa7110_addrs,
 		.i2c_encoder = "adv7175",
-		.mod_encoder = "adv7175",
 		.addrs_encoder = adv717x_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -472,10 +467,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = DC30,
 		.name = "DC30",
 		.i2c_decoder = "vpx3220a",
-		.mod_decoder = "vpx3220",
 		.addrs_decoder = vpx3220_addrs,
 		.i2c_encoder = "adv7175",
-		.mod_encoder = "adv7175",
 		.addrs_encoder = adv717x_addrs,
 		.video_codec = CODEC_TYPE_ZR36050,
 		.video_vfe = CODEC_TYPE_ZR36016,
@@ -505,10 +498,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = DC30plus,
 		.name = "DC30plus",
 		.i2c_decoder = "vpx3220a",
-		.mod_decoder = "vpx3220",
 		.addrs_decoder = vpx3220_addrs,
 		.i2c_encoder = "adv7175",
-		.mod_encoder = "adv7175",
 		.addrs_encoder = adv717x_addrs,
 		.video_codec = CODEC_TYPE_ZR36050,
 		.video_vfe = CODEC_TYPE_ZR36016,
@@ -538,10 +529,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = LML33,
 		.name = "LML33",
 		.i2c_decoder = "bt819a",
-		.mod_decoder = "bt819",
 		.addrs_decoder = bt819_addrs,
 		.i2c_encoder = "bt856",
-		.mod_encoder = "bt856",
 		.addrs_encoder = bt856_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -569,10 +558,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = LML33R10,
 		.name = "LML33R10",
 		.i2c_decoder = "saa7114",
-		.mod_decoder = "saa7115",
 		.addrs_decoder = saa7114_addrs,
 		.i2c_encoder = "adv7170",
-		.mod_encoder = "adv7170",
 		.addrs_encoder = adv717x_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -600,10 +587,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		.type = BUZ,
 		.name = "Buz",
 		.i2c_decoder = "saa7111",
-		.mod_decoder = "saa7115",
 		.addrs_decoder = saa7111_addrs,
 		.i2c_encoder = "saa7185",
-		.mod_encoder = "saa7185",
 		.addrs_encoder = saa7185_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -633,10 +618,8 @@ static struct card_info zoran_cards[NUM_CARDS] __devinitdata = {
 		/* AverMedia chose not to brand the 6-Eyes. Thus it
 		   can't be autodetected, and requires card=x. */
 		.i2c_decoder = "ks0127",
-		.mod_decoder = "ks0127",
 		.addrs_decoder = ks0127_addrs,
 		.i2c_encoder = "bt866",
-		.mod_encoder = "bt866",
 		.addrs_encoder = bt866_addrs,
 		.video_codec = CODEC_TYPE_ZR36060,
 
@@ -1359,13 +1342,13 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
 	}
 
 	zr->decoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
-		&zr->i2c_adapter, zr->card.mod_decoder, zr->card.i2c_decoder,
+		&zr->i2c_adapter, NULL, zr->card.i2c_decoder,
 		0, zr->card.addrs_decoder);
 
-	if (zr->card.mod_encoder)
+	if (zr->card.i2c_encoder)
 		zr->encoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
 			&zr->i2c_adapter,
-			zr->card.mod_encoder, zr->card.i2c_encoder,
+			NULL, zr->card.i2c_encoder,
 			0, zr->card.addrs_encoder);
 
 	dprintk(2,
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 07/16] pvrusb2: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (5 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 06/16] zoran: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-10-03 20:07   ` Mike Isely
  2010-09-24 14:14 ` [PATCH 08/16] sh_vou: " Laurent Pinchart
                   ` (9 subsequent siblings)
  16 siblings, 1 reply; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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 pvrusb2
driver uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/pvrusb2/pvrusb2-hdw.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 70ea578..bef2027 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2082,20 +2082,13 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
 		return -EINVAL;
 	}
 
-	/* Note how the 2nd and 3rd arguments are the same for
-	 * v4l2_i2c_new_subdev().  Why?
-	 * Well the 2nd argument is the module name to load, while the 3rd
-	 * argument is documented in the framework as being the "chipid" -
-	 * and every other place where I can find examples of this, the
-	 * "chipid" appears to just be the module name again.  So here we
-	 * just do the same thing. */
 	if (i2ccnt == 1) {
 		pvr2_trace(PVR2_TRACE_INIT,
 			   "Module ID %u:"
 			   " Setting up with specified i2c address 0x%x",
 			   mid, i2caddr[0]);
 		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
-					 fname, fname,
+					 NULL, fname,
 					 i2caddr[0], NULL);
 	} else {
 		pvr2_trace(PVR2_TRACE_INIT,
@@ -2103,7 +2096,7 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
 			   " Setting up with address probe list",
 			   mid);
 		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
-						fname, fname,
+						NULL, fname,
 						0, i2caddr);
 	}
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 08/16] sh_vou: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (6 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 07/16] pvrusb2: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 09/16] radio-si4713: " Laurent Pinchart
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, remove the module names hardcoded in platform data
and pass a NULL module name to those functions.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the sh_vou
platform data uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/sh/boards/mach-ecovec24/setup.c |    1 -
 arch/sh/boards/mach-se/7724/setup.c  |    1 -
 drivers/media/video/sh_vou.c         |    2 +-
 include/media/sh_vou.h               |    1 -
 4 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 1d7b495..4a9fa5d 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -793,7 +793,6 @@ static struct sh_vou_pdata sh_vou_pdata = {
 	.flags		= SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
 	.board_info	= &ak8813,
 	.i2c_adap	= 0,
-	.module_name	= "ak881x",
 };
 
 static struct resource sh_vou_resources[] = {
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c
index 552ebd9..8cc1d72 100644
--- a/arch/sh/boards/mach-se/7724/setup.c
+++ b/arch/sh/boards/mach-se/7724/setup.c
@@ -550,7 +550,6 @@ static struct sh_vou_pdata sh_vou_pdata = {
 	.flags		= SH_VOU_HSYNC_LOW | SH_VOU_VSYNC_LOW,
 	.board_info	= &ak8813,
 	.i2c_adap	= 0,
-	.module_name	= "ak881x",
 };
 
 static struct resource sh_vou_resources[] = {
diff --git a/drivers/media/video/sh_vou.c b/drivers/media/video/sh_vou.c
index d394187..6e35eaa 100644
--- a/drivers/media/video/sh_vou.c
+++ b/drivers/media/video/sh_vou.c
@@ -1405,7 +1405,7 @@ static int __devinit sh_vou_probe(struct platform_device *pdev)
 		goto ereset;
 
 	subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap,
-			vou_pdata->module_name, vou_pdata->board_info, NULL);
+			NULL, vou_pdata->board_info, NULL);
 	if (!subdev) {
 		ret = -ENOMEM;
 		goto ei2cnd;
diff --git a/include/media/sh_vou.h b/include/media/sh_vou.h
index a3ef302..ec3ba9a 100644
--- a/include/media/sh_vou.h
+++ b/include/media/sh_vou.h
@@ -28,7 +28,6 @@ struct sh_vou_pdata {
 	int i2c_adap;
 	struct i2c_board_info *board_info;
 	unsigned long flags;
-	char *module_name;
 };
 
 #endif
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 09/16] radio-si4713: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (7 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 08/16] sh_vou: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 10/16] soc_camera: " Laurent Pinchart
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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.

As no board seems to use this driver, no platform data has been checked.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/radio/radio-si4713.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index 13554ab..045b10f 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -291,7 +291,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
 		goto unregister_v4l2_dev;
 	}
 
-	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, "si4713_i2c",
+	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, NULL,
 					pdata->subdev_board_info, NULL);
 	if (!sd) {
 		dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n");
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 10/16] soc_camera: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (8 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 09/16] radio-si4713: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 11/16] vpfe_capture: " Laurent Pinchart
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, remove the module names hardcoded in platform data
and pass a NULL module name to those functions.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the soc_camera
platform data uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 arch/arm/mach-mx3/mach-pcm037.c          |    2 --
 arch/arm/mach-mx3/mx31moboard-marxbot.c  |    1 -
 arch/arm/mach-mx3/mx31moboard-smartbot.c |    1 -
 arch/arm/mach-pxa/em-x270.c              |    1 -
 arch/arm/mach-pxa/ezx.c                  |    2 --
 arch/arm/mach-pxa/mioa701.c              |    1 -
 arch/arm/mach-pxa/pcm990-baseboard.c     |    2 --
 arch/sh/boards/mach-ap325rxa/setup.c     |    1 -
 arch/sh/boards/mach-ecovec24/setup.c     |    3 ---
 arch/sh/boards/mach-kfr2r09/setup.c      |    1 -
 arch/sh/boards/mach-migor/setup.c        |    2 --
 drivers/media/video/soc_camera.c         |    2 +-
 12 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-mx3/mach-pcm037.c b/arch/arm/mach-mx3/mach-pcm037.c
index 8a292dd..b097790 100644
--- a/arch/arm/mach-mx3/mach-pcm037.c
+++ b/arch/arm/mach-mx3/mach-pcm037.c
@@ -311,7 +311,6 @@ static struct soc_camera_link iclink_mt9v022 = {
 	.bus_id		= 0,		/* Must match with the camera ID */
 	.board_info	= &pcm037_i2c_camera[1],
 	.i2c_adapter_id	= 2,
-	.module_name	= "mt9v022",
 };
 
 static struct soc_camera_link iclink_mt9t031 = {
@@ -319,7 +318,6 @@ static struct soc_camera_link iclink_mt9t031 = {
 	.power		= pcm037_camera_power,
 	.board_info	= &pcm037_i2c_camera[0],
 	.i2c_adapter_id	= 2,
-	.module_name	= "mt9t031",
 };
 
 static struct i2c_board_info pcm037_i2c_devices[] = {
diff --git a/arch/arm/mach-mx3/mx31moboard-marxbot.c b/arch/arm/mach-mx3/mx31moboard-marxbot.c
index 0551eb3..18069cb 100644
--- a/arch/arm/mach-mx3/mx31moboard-marxbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-marxbot.c
@@ -179,7 +179,6 @@ static struct soc_camera_link base_iclink = {
 	.reset		= marxbot_basecam_reset,
 	.board_info	= &marxbot_i2c_devices[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "mt9t031",
 };
 
 static struct platform_device marxbot_camera[] = {
diff --git a/arch/arm/mach-mx3/mx31moboard-smartbot.c b/arch/arm/mach-mx3/mx31moboard-smartbot.c
index 40c3e75..7abcede 100644
--- a/arch/arm/mach-mx3/mx31moboard-smartbot.c
+++ b/arch/arm/mach-mx3/mx31moboard-smartbot.c
@@ -88,7 +88,6 @@ static struct soc_camera_link base_iclink = {
 	.reset		= smartbot_cam_reset,
 	.board_info	= &smartbot_i2c_devices[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "mt9t031",
 };
 
 static struct platform_device smartbot_camera[] = {
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c
index 0517c17..0c95476 100644
--- a/arch/arm/mach-pxa/em-x270.c
+++ b/arch/arm/mach-pxa/em-x270.c
@@ -1015,7 +1015,6 @@ static struct soc_camera_link iclink = {
 	.power		= em_x270_sensor_power,
 	.board_info	= &em_x270_i2c_cam_info[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "mt9m111",
 };
 
 static struct platform_device em_x270_camera = {
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c
index 626c82b..70dfe08 100644
--- a/arch/arm/mach-pxa/ezx.c
+++ b/arch/arm/mach-pxa/ezx.c
@@ -753,7 +753,6 @@ static struct soc_camera_link a780_iclink = {
 	.flags          = SOCAM_SENSOR_INVERT_PCLK,
 	.i2c_adapter_id = 0,
 	.board_info     = &a780_camera_i2c_board_info,
-	.module_name    = "mt9m111",
 	.power          = a780_camera_power,
 	.reset          = a780_camera_reset,
 };
@@ -1025,7 +1024,6 @@ static struct soc_camera_link a910_iclink = {
 	.bus_id         = 0,
 	.i2c_adapter_id = 0,
 	.board_info     = &a910_camera_i2c_board_info,
-	.module_name    = "mt9m111",
 	.power          = a910_camera_power,
 	.reset          = a910_camera_reset,
 };
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index fa6a708..a197dab 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -707,7 +707,6 @@ static struct soc_camera_link iclink = {
 	.bus_id		= 0, /* Match id in pxa27x_device_camera in device.c */
 	.board_info	= &mioa701_i2c_devices[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "mt9m111",
 };
 
 struct i2c_pxa_platform_data i2c_pdata = {
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c
index f56ae10..f33647a 100644
--- a/arch/arm/mach-pxa/pcm990-baseboard.c
+++ b/arch/arm/mach-pxa/pcm990-baseboard.c
@@ -453,7 +453,6 @@ static struct soc_camera_link iclink[] = {
 		.query_bus_param	= pcm990_camera_query_bus_param,
 		.set_bus_param		= pcm990_camera_set_bus_param,
 		.free_bus		= pcm990_camera_free_bus,
-		.module_name		= "mt9v022",
 	}, {
 		.bus_id			= 0, /* Must match with the camera ID */
 		.board_info		= &pcm990_camera_i2c[1],
@@ -461,7 +460,6 @@ static struct soc_camera_link iclink[] = {
 		.query_bus_param	= pcm990_camera_query_bus_param,
 		.set_bus_param		= pcm990_camera_set_bus_param,
 		.free_bus		= pcm990_camera_free_bus,
-		.module_name		= "mt9m001",
 	},
 };
 
diff --git a/arch/sh/boards/mach-ap325rxa/setup.c b/arch/sh/boards/mach-ap325rxa/setup.c
index de375b6..18b45c6 100644
--- a/arch/sh/boards/mach-ap325rxa/setup.c
+++ b/arch/sh/boards/mach-ap325rxa/setup.c
@@ -481,7 +481,6 @@ static struct soc_camera_link ov7725_link = {
 	.power		= ov7725_power,
 	.board_info	= &ap325rxa_i2c_camera[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "ov772x",
 	.priv		= &ov7725_info,
 };
 
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c
index 4a9fa5d..ae0b138 100644
--- a/arch/sh/boards/mach-ecovec24/setup.c
+++ b/arch/sh/boards/mach-ecovec24/setup.c
@@ -620,7 +620,6 @@ static struct soc_camera_link tw9910_link = {
 	.bus_id		= 1,
 	.power		= tw9910_power,
 	.board_info	= &i2c_camera[0],
-	.module_name	= "tw9910",
 	.priv		= &tw9910_info,
 };
 
@@ -644,7 +643,6 @@ static struct soc_camera_link mt9t112_link1 = {
 	.power		= mt9t112_power1,
 	.bus_id		= 0,
 	.board_info	= &i2c_camera[1],
-	.module_name	= "mt9t112",
 	.priv		= &mt9t112_info1,
 };
 
@@ -667,7 +665,6 @@ static struct soc_camera_link mt9t112_link2 = {
 	.power		= mt9t112_power2,
 	.bus_id		= 1,
 	.board_info	= &i2c_camera[2],
-	.module_name	= "mt9t112",
 	.priv		= &mt9t112_info2,
 };
 
diff --git a/arch/sh/boards/mach-kfr2r09/setup.c b/arch/sh/boards/mach-kfr2r09/setup.c
index 68994a1..1742849 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -333,7 +333,6 @@ static struct soc_camera_link rj54n1_link = {
 	.power		= camera_power,
 	.board_info	= &kfr2r09_i2c_camera,
 	.i2c_adapter_id	= 1,
-	.module_name	= "rj54n1cb0c",
 	.priv		= &rj54n1_priv,
 };
 
diff --git a/arch/sh/boards/mach-migor/setup.c b/arch/sh/boards/mach-migor/setup.c
index 662debe..03af848 100644
--- a/arch/sh/boards/mach-migor/setup.c
+++ b/arch/sh/boards/mach-migor/setup.c
@@ -450,7 +450,6 @@ static struct soc_camera_link ov7725_link = {
 	.power		= ov7725_power,
 	.board_info	= &migor_i2c_camera[0],
 	.i2c_adapter_id	= 0,
-	.module_name	= "ov772x",
 	.priv		= &ov7725_info,
 };
 
@@ -463,7 +462,6 @@ static struct soc_camera_link tw9910_link = {
 	.power		= tw9910_power,
 	.board_info	= &migor_i2c_camera[1],
 	.i2c_adapter_id	= 0,
-	.module_name	= "tw9910",
 	.priv		= &tw9910_info,
 };
 
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index a55d6dc..328cf97 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -898,7 +898,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
 	icl->board_info->platform_data = icd;
 
 	subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
-				icl->module_name, icl->board_info, NULL);
+				NULL, icl->board_info, NULL);
 	if (!subdev)
 		goto ei2cnd;
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 11/16] vpfe_capture: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (9 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 10/16] soc_camera: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 12/16] vpif_display: " Laurent Pinchart
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, don't use the module names hardcoded in platform
data by passing a NULL module name to those functions.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the vpfe_capture
platform data uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/davinci/vpfe_capture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
index b391125..5d90fb0 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1986,7 +1986,7 @@ static __init int vpfe_probe(struct platform_device *pdev)
 		vpfe_dev->sd[i] =
 			v4l2_i2c_new_subdev_board(&vpfe_dev->v4l2_dev,
 						  i2c_adap,
-						  sdinfo->name,
+						  NULL,
 						  &sdinfo->board_info,
 						  NULL);
 		if (vpfe_dev->sd[i]) {
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 12/16] vpif_display: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (10 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 11/16] vpfe_capture: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 13/16] vpif_capture: " Laurent Pinchart
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, don't use the module names hardcoded in platform
data by passing a NULL module name to those functions.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the vpif_display
platform data uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/davinci/vpif_display.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index 912c27b..2523a7f 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -1552,7 +1552,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 
 	for (i = 0; i < subdev_count; i++) {
 		vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
-						i2c_adap, subdevdata[i].name,
+						i2c_adap, NULL,
 						&subdevdata[i].board_info,
 						NULL);
 		if (!vpif_obj.sd[i]) {
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 13/16] vpif_capture: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (11 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 12/16] vpif_display: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 14/16] ivtv: " Laurent Pinchart
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, don't use the module names hardcoded in platform
data by passing a NULL module name to those functions.

The only platform using the VPIF capture device (DM646x EVM) hardcodes
the module names to invalid values (tvp514x-0 and tvp514x-1). As this is
already broken, there's no risk of breaking it more.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/davinci/vpif_capture.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 730bd4c..4b8e70c 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -2012,7 +2012,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 		vpif_obj.sd[i] =
 			v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
 						  i2c_adap,
-						  subdevdata->name,
+						  NULL,
 						  &subdevdata->board_info,
 						  NULL);
 
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 14/16] ivtv: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (12 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 13/16] vpif_capture: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 15/16] cx18: " Laurent Pinchart
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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.

The sub-devices without a listed module name don't result in and I2C
sub-device being created, as they either are IR devices or don't have an
I2C address listed. It's thus safe to rely on modaliases only.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the ivtv driver
uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/ivtv/ivtv-i2c.c |   42 ++++++----------------------------
 1 files changed, 8 insertions(+), 34 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index d391bbd..d104c98 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -121,31 +121,6 @@ static const u8 hw_addrs[] = {
 };
 
 /* This array should match the IVTV_HW_ defines */
-static const char *hw_modules[] = {
-	"cx25840",
-	"saa7115",
-	"saa7127",
-	"msp3400",
-	"tuner",
-	"wm8775",
-	"cs53l32a",
-	NULL,
-	"saa7115",
-	"upd64031a",
-	"upd64083",
-	"saa717x",
-	"wm8739",
-	"vp27smpx",
-	"m52790",
-	NULL,
-	NULL,		/* IVTV_HW_I2C_IR_RX_AVER */
-	NULL,		/* IVTV_HW_I2C_IR_RX_HAUP_EXT */
-	NULL,		/* IVTV_HW_I2C_IR_RX_HAUP_INT */
-	NULL,		/* IVTV_HW_Z8F0811_IR_TX_HAUP */
-	NULL,		/* IVTV_HW_Z8F0811_IR_RX_HAUP */
-};
-
-/* This array should match the IVTV_HW_ defines */
 static const char * const hw_devicenames[] = {
 	"cx25840",
 	"saa7115",
@@ -256,7 +231,6 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
 {
 	struct v4l2_subdev *sd;
 	struct i2c_adapter *adap = &itv->i2c_adap;
-	const char *mod = hw_modules[idx];
 	const char *type = hw_devicenames[idx];
 	u32 hw = 1 << idx;
 
@@ -265,17 +239,17 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
 	if (hw == IVTV_HW_TUNER) {
 		/* special tuner handling */
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, mod, type,
+				adap, NULL, type,
 				0, itv->card_i2c->radio);
 		if (sd)
 			sd->grp_id = 1 << idx;
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, mod, type,
+				adap, NULL, type,
 				0, itv->card_i2c->demod);
 		if (sd)
 			sd->grp_id = 1 << idx;
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, mod, type,
+				adap, NULL, type,
 				0, itv->card_i2c->tv);
 		if (sd)
 			sd->grp_id = 1 << idx;
@@ -292,16 +266,17 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
 	/* It's an I2C device other than an analog tuner or IR chip */
 	if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) {
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, mod, type, 0, I2C_ADDRS(hw_addrs[idx]));
+				adap, NULL, type, 0, I2C_ADDRS(hw_addrs[idx]));
 	} else if (hw == IVTV_HW_CX25840) {
 		struct cx25840_platform_data pdata;
 
 		pdata.pvr150_workaround = itv->pvr150_workaround;
 		sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev,
-				adap, mod, type, 0, &pdata, hw_addrs[idx], NULL);
+				adap, NULL, type, 0, &pdata, hw_addrs[idx],
+				NULL);
 	} else {
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, mod, type, hw_addrs[idx], NULL);
+				adap, NULL, type, hw_addrs[idx], NULL);
 	}
 	if (sd)
 		sd->grp_id = 1 << idx;
@@ -705,8 +680,7 @@ int init_ivtv_i2c(struct ivtv *itv)
 	/* Sanity checks for the I2C hardware arrays. They must be the
 	 * same size.
 	 */
-	if (ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs) ||
-	    ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_modules)) {
+	if (ARRAY_SIZE(hw_devicenames) != ARRAY_SIZE(hw_addrs)) {
 		IVTV_ERR("Mismatched I2C hardware arrays\n");
 		return -ENODEV;
 	}
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 15/16] cx18: Don't use module names to load I2C modules
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (13 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 14/16] ivtv: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-09-24 14:14 ` [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions Laurent Pinchart
  2010-09-24 19:00 ` [PATCH 00/16] Use modaliases to load I2C modules - please review Guennadi Liakhovetski
  16 siblings, 0 replies; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

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.

The sub-devices without a listed module name don't result in and I2C
sub-device being created, as they either are IR devices or don't have an
I2C address listed. It's thus safe to rely on modaliases only.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the cx18 driver
uses.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/video/cx18/cx18-i2c.c |   23 +++++------------------
 1 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 809f7d3..3b67984 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -71,19 +71,6 @@ static const u8 hw_bus[] = {
 };
 
 /* This array should match the CX18_HW_ defines */
-static const char * const hw_modules[] = {
-	"tuner",	/* CX18_HW_TUNER */
-	NULL,		/* CX18_HW_TVEEPROM */
-	"cs5345",	/* CX18_HW_CS5345 */
-	NULL,		/* CX18_HW_DVB */
-	NULL,		/* CX18_HW_418_AV */
-	NULL,		/* CX18_HW_GPIO_MUX */
-	NULL,		/* CX18_HW_GPIO_RESET_CTRL */
-	NULL,		/* CX18_HW_Z8F0811_IR_TX_HAUP */
-	NULL,		/* CX18_HW_Z8F0811_IR_RX_HAUP */
-};
-
-/* This array should match the CX18_HW_ defines */
 static const char * const hw_devicenames[] = {
 	"tuner",
 	"tveeprom",
@@ -125,7 +112,6 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
 	struct v4l2_subdev *sd;
 	int bus = hw_bus[idx];
 	struct i2c_adapter *adap = &cx->i2c_adap[bus];
-	const char *mod = hw_modules[idx];
 	const char *type = hw_devicenames[idx];
 	u32 hw = 1 << idx;
 
@@ -135,15 +121,15 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
 	if (hw == CX18_HW_TUNER) {
 		/* special tuner group handling */
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, mod, type, 0, cx->card_i2c->radio);
+				adap, NULL, type, 0, cx->card_i2c->radio);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, mod, type, 0, cx->card_i2c->demod);
+				adap, NULL, type, 0, cx->card_i2c->demod);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, mod, type, 0, cx->card_i2c->tv);
+				adap, NULL, type, 0, cx->card_i2c->tv);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		return sd != NULL ? 0 : -1;
@@ -157,7 +143,8 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
 		return -1;
 
 	/* It's an I2C device other than an analog tuner or IR chip */
-	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, mod, type, hw_addrs[idx], NULL);
+	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, NULL, type, hw_addrs[idx],
+				 NULL);
 	if (sd != NULL)
 		sd->grp_id = hw;
 	return sd != NULL ? 0 : -1;
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (14 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 15/16] cx18: " Laurent Pinchart
@ 2010-09-24 14:14 ` Laurent Pinchart
  2010-10-03 20:07   ` Mike Isely
  2010-09-24 19:00 ` [PATCH 00/16] Use modaliases to load I2C modules - please review Guennadi Liakhovetski
  16 siblings, 1 reply; 25+ messages in thread
From: Laurent Pinchart @ 2010-09-24 14:14 UTC (permalink / raw)
  To: linux-media
  Cc: Hans Verkuil, Jean Delvare, Guennadi Liakhovetski, Pete Eberlein,
	Mike Isely, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri

The argument isn't used anymore by the functions, remote it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/radio/radio-si4713.c            |    2 +-
 drivers/media/video/au0828/au0828-cards.c     |    4 ++--
 drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++++++++-----------
 drivers/media/video/cafe_ccic.c               |    2 +-
 drivers/media/video/cx18/cx18-i2c.c           |    8 ++++----
 drivers/media/video/cx231xx/cx231xx-cards.c   |    4 ++--
 drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
 drivers/media/video/cx23885/cx23885-video.c   |    4 ++--
 drivers/media/video/cx88/cx88-cards.c         |    9 ++++-----
 drivers/media/video/cx88/cx88-video.c         |    7 +++----
 drivers/media/video/davinci/vpfe_capture.c    |    1 -
 drivers/media/video/davinci/vpif_capture.c    |    1 -
 drivers/media/video/davinci/vpif_display.c    |    2 +-
 drivers/media/video/em28xx/em28xx-cards.c     |   18 +++++++++---------
 drivers/media/video/fsl-viu.c                 |    2 +-
 drivers/media/video/ivtv/ivtv-i2c.c           |   22 +++++++++-------------
 drivers/media/video/mxb.c                     |   12 ++++++------
 drivers/media/video/pvrusb2/pvrusb2-hdw.c     |    6 ++----
 drivers/media/video/saa7134/saa7134-cards.c   |    8 ++++----
 drivers/media/video/saa7134/saa7134-core.c    |    4 ++--
 drivers/media/video/sh_vou.c                  |    2 +-
 drivers/media/video/soc_camera.c              |    2 +-
 drivers/media/video/usbvision/usbvision-i2c.c |    6 +++---
 drivers/media/video/v4l2-common.c             |   15 +++++----------
 drivers/media/video/vino.c                    |    4 ++--
 drivers/media/video/zoran/zoran_card.c        |    5 ++---
 drivers/staging/go7007/go7007-driver.c        |    2 +-
 drivers/staging/tm6000/tm6000-cards.c         |    4 ++--
 include/media/v4l2-common.h                   |   16 ++++++----------
 29 files changed, 88 insertions(+), 108 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
index 045b10f..d49c215 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -291,7 +291,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
 		goto unregister_v4l2_dev;
 	}
 
-	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, NULL,
+	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter,
 					pdata->subdev_board_info, NULL);
 	if (!sd) {
 		dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n");
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
index 0453816..01be89f 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -212,7 +212,7 @@ void au0828_card_setup(struct au0828_dev *dev)
 		   be abstracted out if we ever need to support a different
 		   demod) */
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				NULL, "au8522", 0x8e >> 1, NULL);
+				"au8522", 0x8e >> 1, NULL);
 		if (sd == NULL)
 			printk(KERN_ERR "analog subdev registration failed\n");
 	}
@@ -221,7 +221,7 @@ void au0828_card_setup(struct au0828_dev *dev)
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		/* Load the tuner module, which does the attach */
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				NULL, "tuner", dev->board.tuner_addr, NULL);
+				"tuner", dev->board.tuner_addr, NULL);
 		if (sd == NULL)
 			printk(KERN_ERR "tuner subdev registration fail\n");
 
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
index 87d8b00..49efcf6 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3529,7 +3529,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, NULL, "saa6588", 0, addrs);
+			&btv->c.i2c_adap, "saa6588", 0, addrs);
 		btv->has_saa6588 = (sd != NULL);
 	}
 
@@ -3554,7 +3554,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, NULL, "msp3400", 0, addrs);
+			&btv->c.i2c_adap, "msp3400", 0, addrs);
 		if (btv->sd_msp34xx)
 			return;
 		goto no_audio;
@@ -3568,7 +3568,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
+				&btv->c.i2c_adap, "tda7432", 0, addrs))
 			return;
 		goto no_audio;
 	}
@@ -3576,7 +3576,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
 	case 3: {
 		/* The user specified that we should probe for tvaudio */
 		btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
+			&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
 		if (btv->sd_tvaudio)
 			return;
 		goto no_audio;
@@ -3596,11 +3596,11 @@ void __devinit bttv_init_card2(struct bttv *btv)
 	   found is really something else (e.g. a tea6300). */
 	if (!bttv_tvcards[btv->c.type].no_msp34xx) {
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, NULL, "msp3400",
+			&btv->c.i2c_adap, "msp3400",
 			0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
 	} else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
 		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-			&btv->c.i2c_adap, NULL, "msp3400",
+			&btv->c.i2c_adap, "msp3400",
 			0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
 	}
 
@@ -3616,13 +3616,13 @@ void __devinit bttv_init_card2(struct bttv *btv)
 		};
 
 		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
+				&btv->c.i2c_adap, "tda7432", 0, addrs))
 			return;
 	}
 
 	/* Now see if we can find one of the tvaudio devices. */
 	btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-		&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
+		&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
 	if (btv->sd_tvaudio)
 		return;
 
@@ -3646,13 +3646,13 @@ void __devinit bttv_init_tuner(struct bttv *btv)
 		/* Load tuner module before issuing tuner config call! */
 		if (bttv_tvcards[btv->c.type].has_radio)
 			v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, NULL, "tuner",
+				&btv->c.i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
 		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, NULL, "tuner",
+				&btv->c.i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
-				&btv->c.i2c_adap, NULL, "tuner",
+				&btv->c.i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
 
 		tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 780f3ff..f121610 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2014,7 +2014,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 
 	cam->sensor_addr = 0x42;
 	cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, &cam->i2c_adapter,
-			NULL, "ov7670", cam->sensor_addr, NULL);
+			"ov7670", cam->sensor_addr, NULL);
 	if (cam->sensor == NULL) {
 		ret = -ENODEV;
 		goto out_smbus;
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
index 3b67984..9ae6915 100644
--- a/drivers/media/video/cx18/cx18-i2c.c
+++ b/drivers/media/video/cx18/cx18-i2c.c
@@ -121,15 +121,15 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
 	if (hw == CX18_HW_TUNER) {
 		/* special tuner group handling */
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, NULL, type, 0, cx->card_i2c->radio);
+				adap, type, 0, cx->card_i2c->radio);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, NULL, type, 0, cx->card_i2c->demod);
+				adap, type, 0, cx->card_i2c->demod);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
-				adap, NULL, type, 0, cx->card_i2c->tv);
+				adap, type, 0, cx->card_i2c->tv);
 		if (sd != NULL)
 			sd->grp_id = hw;
 		return sd != NULL ? 0 : -1;
@@ -143,7 +143,7 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
 		return -1;
 
 	/* It's an I2C device other than an analog tuner or IR chip */
-	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, NULL, type, hw_addrs[idx],
+	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, type, hw_addrs[idx],
 				 NULL);
 	if (sd != NULL)
 		sd->grp_id = hw;
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
index daaa3b4..129290e 100644
--- a/drivers/media/video/cx231xx/cx231xx-cards.c
+++ b/drivers/media/video/cx231xx/cx231xx-cards.c
@@ -319,7 +319,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
 	if (dev->board.decoder == CX231XX_AVDECODER) {
 		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 					&dev->i2c_bus[0].i2c_adap,
-					NULL, "cx25840", 0x88 >> 1, NULL);
+					"cx25840", 0x88 >> 1, NULL);
 		if (dev->sd_cx25840 == NULL)
 			cx231xx_info("cx25840 subdev registration failure\n");
 		cx25840_call(dev, core, load_fw);
@@ -329,7 +329,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		dev->sd_tuner =	v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[1].i2c_adap,
-				NULL, "tuner", 0xc2 >> 1, NULL);
+				"tuner", 0xc2 >> 1, NULL);
 		if (dev->sd_tuner == NULL)
 			cx231xx_info("tuner subdev registration failure\n");
 
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
index db05400..8861309 100644
--- a/drivers/media/video/cx23885/cx23885-cards.c
+++ b/drivers/media/video/cx23885/cx23885-cards.c
@@ -1247,7 +1247,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
 	case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200:
 		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[2].i2c_adap,
-				NULL, "cx25840", 0x88 >> 1, NULL);
+				"cx25840", 0x88 >> 1, NULL);
 		if (dev->sd_cx25840) {
 			dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE;
 			v4l2_subdev_call(dev->sd_cx25840, core, load_fw);
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
index 4920ddd..d6a87c6 100644
--- a/drivers/media/video/cx23885/cx23885-video.c
+++ b/drivers/media/video/cx23885/cx23885-video.c
@@ -1512,10 +1512,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
 		if (dev->tuner_addr)
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
 				&dev->i2c_bus[1].i2c_adap,
-				NULL, "tuner", dev->tuner_addr, NULL);
+				"tuner", dev->tuner_addr, NULL);
 		else
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_bus[1].i2c_adap, NULL,
+				&dev->i2c_bus[1].i2c_adap,
 				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV));
 		if (sd) {
 			struct tuner_setup tun_setup;
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
index b0613f7..265f869 100644
--- a/drivers/media/video/cx88/cx88-cards.c
+++ b/drivers/media/video/cx88/cx88-cards.c
@@ -3485,19 +3485,18 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
 		   later code configures a tea5767.
 		 */
 		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				NULL, "tuner",
-				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
+				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
 		if (has_demod)
 			v4l2_i2c_new_subdev(&core->v4l2_dev,
-				&core->i2c_adap, NULL, "tuner",
+				&core->i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (core->board.tuner_addr == ADDR_UNSET) {
 			v4l2_i2c_new_subdev(&core->v4l2_dev,
-				&core->i2c_adap, NULL, "tuner",
+				&core->i2c_adap, "tuner",
 				0, has_demod ? tv_addrs + 4 : tv_addrs);
 		} else {
 			v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				NULL, "tuner", core->board.tuner_addr, NULL);
+				"tuner", core->board.tuner_addr, NULL);
 		}
 	}
 
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
index f9d1877..154051a 100644
--- a/drivers/media/video/cx88/cx88-video.c
+++ b/drivers/media/video/cx88/cx88-video.c
@@ -1873,14 +1873,13 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
 
 	if (core->board.audio_chip == V4L2_IDENT_WM8775)
 		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
-				NULL, "wm8775", 0x36 >> 1, NULL);
+				"wm8775", 0x36 >> 1, NULL);
 
 	if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) {
 		/* This probes for a tda9874 as is used on some
 		   Pixelview Ultra boards. */
-		v4l2_i2c_new_subdev(&core->v4l2_dev,
-				&core->i2c_adap,
-				NULL, "tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
+		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
+				"tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
 	}
 
 	switch (core->boardnr) {
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
index 5d90fb0..0314bf4 100644
--- a/drivers/media/video/davinci/vpfe_capture.c
+++ b/drivers/media/video/davinci/vpfe_capture.c
@@ -1986,7 +1986,6 @@ static __init int vpfe_probe(struct platform_device *pdev)
 		vpfe_dev->sd[i] =
 			v4l2_i2c_new_subdev_board(&vpfe_dev->v4l2_dev,
 						  i2c_adap,
-						  NULL,
 						  &sdinfo->board_info,
 						  NULL);
 		if (vpfe_dev->sd[i]) {
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
index 4b8e70c..0193ffd 100644
--- a/drivers/media/video/davinci/vpif_capture.c
+++ b/drivers/media/video/davinci/vpif_capture.c
@@ -2012,7 +2012,6 @@ static __init int vpif_probe(struct platform_device *pdev)
 		vpif_obj.sd[i] =
 			v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
 						  i2c_adap,
-						  NULL,
 						  &subdevdata->board_info,
 						  NULL);
 
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
index 2523a7f..8d156d9 100644
--- a/drivers/media/video/davinci/vpif_display.c
+++ b/drivers/media/video/davinci/vpif_display.c
@@ -1552,7 +1552,7 @@ static __init int vpif_probe(struct platform_device *pdev)
 
 	for (i = 0; i < subdev_count; i++) {
 		vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
-						i2c_adap, NULL,
+						i2c_adap,
 						&subdevdata[i].board_info,
 						NULL);
 		if (!vpif_obj.sd[i]) {
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 7af7860..49feed2 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2523,39 +2523,39 @@ void em28xx_card_setup(struct em28xx *dev)
 	/* request some modules */
 	if (dev->board.has_msp34xx)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			NULL, "msp3400", 0, msp3400_addrs);
+			"msp3400", 0, msp3400_addrs);
 
 	if (dev->board.decoder == EM28XX_SAA711X)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			NULL, "saa7115_auto", 0, saa711x_addrs);
+			"saa7115_auto", 0, saa711x_addrs);
 
 	if (dev->board.decoder == EM28XX_TVP5150)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			NULL, "tvp5150", 0, tvp5150_addrs);
+			"tvp5150", 0, tvp5150_addrs);
 
 	if (dev->em28xx_sensor == EM28XX_MT9V011) {
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-			 &dev->i2c_adap, NULL, "mt9v011", 0, mt9v011_addrs);
+			 &dev->i2c_adap, "mt9v011", 0, mt9v011_addrs);
 		v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
 	}
 
 
 	if (dev->board.adecoder == EM28XX_TVAUDIO)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			NULL, "tvaudio", dev->board.tvaudio_addr, NULL);
+			"tvaudio", dev->board.tvaudio_addr, NULL);
 
 	if (dev->board.tuner_type != TUNER_ABSENT) {
 		int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
 
 		if (dev->board.radio.type)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				NULL, "tuner", dev->board.radio_addr, NULL);
+				"tuner", dev->board.radio_addr, NULL);
 
 		if (has_demod)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (dev->tuner_addr == 0) {
 			enum v4l2_i2c_tuner_type type =
@@ -2563,14 +2563,14 @@ void em28xx_card_setup(struct em28xx *dev)
 			struct v4l2_subdev *sd;
 
 			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(type));
 
 			if (sd)
 				dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
 		} else {
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				NULL, "tuner", dev->tuner_addr, NULL);
+				"tuner", dev->tuner_addr, NULL);
 		}
 	}
 
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c
index e7f63c1..b0f3f10 100644
--- a/drivers/media/video/fsl-viu.c
+++ b/drivers/media/video/fsl-viu.c
@@ -1485,7 +1485,7 @@ static int __devinit viu_of_probe(struct of_device *op,
 
 	ad = i2c_get_adapter(0);
 	viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad,
-			NULL, "saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
+			"saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
 
 	viu_dev->vidq.timeout.function = viu_vid_timeout;
 	viu_dev->vidq.timeout.data     = (unsigned long)viu_dev;
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
index d104c98..b56d8c0 100644
--- a/drivers/media/video/ivtv/ivtv-i2c.c
+++ b/drivers/media/video/ivtv/ivtv-i2c.c
@@ -238,19 +238,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
 		return -1;
 	if (hw == IVTV_HW_TUNER) {
 		/* special tuner handling */
-		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, NULL, type,
-				0, itv->card_i2c->radio);
+		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
+				itv->card_i2c->radio);
 		if (sd)
 			sd->grp_id = 1 << idx;
-		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, NULL, type,
-				0, itv->card_i2c->demod);
+		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
+				itv->card_i2c->demod);
 		if (sd)
 			sd->grp_id = 1 << idx;
-		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, NULL, type,
-				0, itv->card_i2c->tv);
+		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
+				itv->card_i2c->tv);
 		if (sd)
 			sd->grp_id = 1 << idx;
 		return sd ? 0 : -1;
@@ -266,17 +263,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
 	/* It's an I2C device other than an analog tuner or IR chip */
 	if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) {
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, NULL, type, 0, I2C_ADDRS(hw_addrs[idx]));
+				adap, type, 0, I2C_ADDRS(hw_addrs[idx]));
 	} else if (hw == IVTV_HW_CX25840) {
 		struct cx25840_platform_data pdata;
 
 		pdata.pvr150_workaround = itv->pvr150_workaround;
 		sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev,
-				adap, NULL, type, 0, &pdata, hw_addrs[idx],
-				NULL);
+				adap, type, 0, &pdata, hw_addrs[idx], NULL);
 	} else {
 		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
-				adap, NULL, type, hw_addrs[idx], NULL);
+				adap, type, hw_addrs[idx], NULL);
 	}
 	if (sd)
 		sd->grp_id = 1 << idx;
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
index 4c9c1bb..8104129 100644
--- a/drivers/media/video/mxb.c
+++ b/drivers/media/video/mxb.c
@@ -185,17 +185,17 @@ static int mxb_probe(struct saa7146_dev *dev)
 	}
 
 	mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "saa7111", I2C_SAA7111A, NULL);
+			"saa7111", I2C_SAA7111A, NULL);
 	mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "tea6420", I2C_TEA6420_1, NULL);
+			"tea6420", I2C_TEA6420_1, NULL);
 	mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "tea6420", I2C_TEA6420_2, NULL);
+			"tea6420", I2C_TEA6420_2, NULL);
 	mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "tea6415c", I2C_TEA6415C, NULL);
+			"tea6415c", I2C_TEA6415C, NULL);
 	mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "tda9840", I2C_TDA9840, NULL);
+			"tda9840", I2C_TDA9840, NULL);
 	mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
-			NULL, "tuner", I2C_TUNER, NULL);
+			"tuner", I2C_TUNER, NULL);
 
 	/* check if all devices are present */
 	if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index bef2027..66ad516 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -2088,16 +2088,14 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
 			   " Setting up with specified i2c address 0x%x",
 			   mid, i2caddr[0]);
 		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
-					 NULL, fname,
-					 i2caddr[0], NULL);
+					 fname, i2caddr[0], NULL);
 	} else {
 		pvr2_trace(PVR2_TRACE_INIT,
 			   "Module ID %u:"
 			   " Setting up with address probe list",
 			   mid);
 		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
-						NULL, fname,
-						0, i2caddr);
+					 fname, 0, i2caddr);
 	}
 
 	if (!sd) {
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
index 10a6cbf..4c69f48 100644
--- a/drivers/media/video/saa7134/saa7134-cards.c
+++ b/drivers/media/video/saa7134/saa7134-cards.c
@@ -7551,22 +7551,22 @@ int saa7134_board_init2(struct saa7134_dev *dev)
 		   so we do not need to probe for a radio tuner device. */
 		if (dev->radio_type != UNSET)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				dev->radio_addr, NULL);
 		if (has_demod)
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		if (dev->tuner_addr == ADDR_UNSET) {
 			enum v4l2_i2c_tuner_type type =
 				has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
 
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				0, v4l2_i2c_tuner_addrs(type));
 		} else {
 			v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "tuner",
+				&dev->i2c_adap, "tuner",
 				dev->tuner_addr, NULL);
 		}
 	}
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 2de110f..70469d9 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -991,7 +991,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 	if (card_is_empress(dev)) {
 		struct v4l2_subdev *sd =
 			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-				NULL, "saa6752hs",
+				"saa6752hs",
 				saa7134_boards[dev->board].empress_addr, NULL);
 
 		if (sd)
@@ -1002,7 +1002,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
 		struct v4l2_subdev *sd;
 
 		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
-				&dev->i2c_adap, NULL, "saa6588",
+				&dev->i2c_adap, "saa6588",
 				0, I2C_ADDRS(saa7134_boards[dev->board].rds_addr));
 		if (sd) {
 			printk(KERN_INFO "%s: found RDS decoder\n", dev->name);
diff --git a/drivers/media/video/sh_vou.c b/drivers/media/video/sh_vou.c
index 6e35eaa..a3ce9bf 100644
--- a/drivers/media/video/sh_vou.c
+++ b/drivers/media/video/sh_vou.c
@@ -1405,7 +1405,7 @@ static int __devinit sh_vou_probe(struct platform_device *pdev)
 		goto ereset;
 
 	subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap,
-			NULL, vou_pdata->board_info, NULL);
+			vou_pdata->board_info, NULL);
 	if (!subdev) {
 		ret = -ENOMEM;
 		goto ei2cnd;
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index 328cf97..9aa2870 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -898,7 +898,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
 	icl->board_info->platform_data = icd;
 
 	subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
-				NULL, icl->board_info, NULL);
+				icl->board_info, NULL);
 	if (!subdev)
 		goto ei2cnd;
 
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
index e3bbae2..81dd53b 100644
--- a/drivers/media/video/usbvision/usbvision-i2c.c
+++ b/drivers/media/video/usbvision/usbvision-i2c.c
@@ -251,7 +251,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
 		   hit-and-miss. */
 		mdelay(10);
 		v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, NULL,
+				&usbvision->i2c_adap,
 				"saa7115_auto", 0, saa711x_addrs);
 		break;
 	}
@@ -261,14 +261,14 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
 		struct tuner_setup tun_setup;
 
 		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, NULL,
+				&usbvision->i2c_adap,
 				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 		/* depending on whether we found a demod or not, select
 		   the tuner type. */
 		type = sd ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
 
 		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
-				&usbvision->i2c_adap, NULL,
+				&usbvision->i2c_adap,
 				"tuner", 0, v4l2_i2c_tuner_addrs(type));
 
 		if (sd == NULL)
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
index 120b4ac..7a23399 100644
--- a/drivers/media/video/v4l2-common.c
+++ b/drivers/media/video/v4l2-common.c
@@ -368,18 +368,15 @@ EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
 
 /* Load an i2c sub-device. */
 struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
-		struct i2c_adapter *adapter, const char *module_name,
-		struct i2c_board_info *info, const unsigned short *probe_addrs)
+		struct i2c_adapter *adapter, struct i2c_board_info *info,
+		const unsigned short *probe_addrs)
 {
 	struct v4l2_subdev *sd = NULL;
 	struct i2c_client *client;
 
 	BUG_ON(!v4l2_dev);
 
-	if (module_name)
-		request_module(module_name);
-	else
-		request_module(I2C_MODULE_PREFIX "%s", info->type);
+	request_module(I2C_MODULE_PREFIX "%s", info->type);
 
 	/* Create the i2c client */
 	if (info->addr == 0 && probe_addrs)
@@ -431,8 +428,7 @@ error:
 EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);
 
 struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
-		struct i2c_adapter *adapter,
-		const char *module_name, const char *client_type,
+		struct i2c_adapter *adapter, const char *client_type,
 		int irq, void *platform_data,
 		u8 addr, const unsigned short *probe_addrs)
 {
@@ -446,8 +442,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
 	info.irq = irq;
 	info.platform_data = platform_data;
 
-	return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, module_name,
-			&info, probe_addrs);
+	return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs);
 }
 EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg);
 
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
index e5e005d..7e7eec4 100644
--- a/drivers/media/video/vino.c
+++ b/drivers/media/video/vino.c
@@ -4334,10 +4334,10 @@ static int __init vino_module_init(void)
 
 	vino_drvdata->decoder =
 		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
-			       NULL, "saa7191", 0, I2C_ADDRS(0x45));
+			       "saa7191", 0, I2C_ADDRS(0x45));
 	vino_drvdata->camera =
 		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
-			       NULL, "indycam", 0, I2C_ADDRS(0x2b));
+			       "indycam", 0, I2C_ADDRS(0x2b));
 
 	dprintk("init complete!\n");
 
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c
index 0aac376..76179f7 100644
--- a/drivers/media/video/zoran/zoran_card.c
+++ b/drivers/media/video/zoran/zoran_card.c
@@ -1342,13 +1342,12 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
 	}
 
 	zr->decoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
-		&zr->i2c_adapter, NULL, zr->card.i2c_decoder,
+		&zr->i2c_adapter, zr->card.i2c_decoder,
 		0, zr->card.addrs_decoder);
 
 	if (zr->card.i2c_encoder)
 		zr->encoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
-			&zr->i2c_adapter,
-			NULL, zr->card.i2c_encoder,
+			&zr->i2c_adapter, zr->card.i2c_encoder,
 			0, zr->card.addrs_encoder);
 
 	dprintk(2,
diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
index 0a1d925..4e20387 100644
--- a/drivers/staging/go7007/go7007-driver.c
+++ b/drivers/staging/go7007/go7007-driver.c
@@ -199,7 +199,7 @@ static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
 	struct go7007 *go = i2c_get_adapdata(adapter);
 	struct v4l2_device *v4l2_dev = &go->v4l2_dev;
 
-	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL))
+	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
 		return 0;
 
 	printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c
index 1c3b1b6..500a78c 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -545,7 +545,7 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
 
 	/* Load tuner module */
 	v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-		NULL, "tuner", dev->tuner_addr, NULL);
+		"tuner", dev->tuner_addr, NULL);
 
 	memset(&tun_setup, 0, sizeof(tun_setup));
 	tun_setup.type = dev->tuner_type;
@@ -683,7 +683,7 @@ static int tm6000_init_dev(struct tm6000_core *dev)
 
 	if (dev->caps.has_tda9874)
 		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
-			NULL, "tvaudio", I2C_ADDR_TDA9874, NULL);
+			"tvaudio", I2C_ADDR_TDA9874, NULL);
 
 	/* register and initialize V4L2 */
 	rc = tm6000_v4l2_register(dev);
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 98b3264..4bcda5a 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -137,31 +137,27 @@ struct v4l2_subdev_ops;
 
 
 /* Load an i2c module and return an initialized v4l2_subdev struct.
-   Only call request_module if module_name != NULL.
    The client_type argument is the name of the chip that's on the adapter. */
 struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
-		struct i2c_adapter *adapter,
-		const char *module_name, const char *client_type,
+		struct i2c_adapter *adapter, const char *client_type,
 		int irq, void *platform_data,
 		u8 addr, const unsigned short *probe_addrs);
 
 /* Load an i2c module and return an initialized v4l2_subdev struct.
-   Only call request_module if module_name != NULL.
    The client_type argument is the name of the chip that's on the adapter. */
 static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
-		struct i2c_adapter *adapter,
-		const char *module_name, const char *client_type,
+		struct i2c_adapter *adapter, const char *client_type,
 		u8 addr, const unsigned short *probe_addrs)
 {
-	return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, module_name,
-				client_type, 0, NULL, addr, probe_addrs);
+	return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL,
+				       addr, probe_addrs);
 }
 
 struct i2c_board_info;
 
 struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
-		struct i2c_adapter *adapter, const char *module_name,
-		struct i2c_board_info *info, const unsigned short *probe_addrs);
+		struct i2c_adapter *adapter, struct i2c_board_info *info,
+		const unsigned short *probe_addrs);
 
 /* Initialize an v4l2_subdev with data from an i2c_client struct */
 void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
-- 
1.7.2.2


^ permalink raw reply related	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/16] Use modaliases to load I2C modules - please review
  2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
                   ` (15 preceding siblings ...)
  2010-09-24 14:14 ` [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions Laurent Pinchart
@ 2010-09-24 19:00 ` Guennadi Liakhovetski
  2010-10-05 16:41   ` Guennadi Liakhovetski
  16 siblings, 1 reply; 25+ messages in thread
From: Guennadi Liakhovetski @ 2010-09-24 19:00 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Linux Media Mailing List, Hans Verkuil, Jean Delvare,
	Pete Eberlein, Mike Isely, Eduardo Valentin, Andy Walls,
	Vaibhav Hiremath, Muralidharan Karicheri

Hi Laurent

On Fri, 24 Sep 2010, Laurent Pinchart wrote:

> Hi everybody,
> 
> Here's a bunch of patches (on top of staging/v2.6.37) that remove the
> module_name argument to the v4l2_i2c_new_subdev* functions.

Something seems to be wrong with them. On arch/arm/mach-mx3/mach-pcm037.c 
without your patches both mt9mt031 and mt9v022 drivers attempt to load 
(only one sensor attached, so, the second one fails probing, but stays 
loaded, of course), with your patches only one driver loads. As I told 
you, I'm leaving early tomorrow, so, unfortunately I cannot investigate 
this further now, please, see if you find the problem, I'll be back on 
Monday 04.10.

Thanks
Guennadi

> 
> The module name is used by those functions to load the module corresponding
> to the I2C sub-device being instanciated. As the I2C modules now support
> modalias (and have been for quite some time), the module name isn't necessary
> anymore.
> 
> The first patch adds the ability to load I2C modules based on modaliases when
> the module name passed to the v4l_i2c_new_subdev* functions is NULL. This is
> never the case with the in-tree drivers, so there shouldn't be any regression.
> 
> The 14 next patches modify all drivers that call those functions to pass a NULL
> module name. Patch 2/16 touches all the drivers that hardcode the module name
> directly when calling the function, and the remaining 13 patches do the same
> for driver that fetch the module name from platform data or from other sources
> (such as static tables). I've checked all I2C modules used by the drivers
> modified in those patches to make sure they have a proper module devices table.
> 
> The last patch finally removes the module_name argument, as all callers now
> pass a NULL value.
> 
> The code has obviously not been tested, as I lack the necessary hardware. I've
> tested the V4L2 core changes with the OMAP3 ISP driver. All x86 drivers have
> been compile-tested.
> 
> Laurent Pinchart (16):
>   v4l: Load I2C modules based on modalias
>   v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*
>   go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules
>   go7007: Fix the TW2804 I2C type name
>   go7007: Don't use module names to load I2C modules
>   zoran: Don't use module names to load I2C modules
>   pvrusb2: Don't use module names to load I2C modules
>   sh_vou: Don't use module names to load I2C modules
>   radio-si4713: Don't use module names to load I2C modules
>   soc_camera: Don't use module names to load I2C modules
>   vpfe_capture: Don't use module names to load I2C modules
>   vpif_display: Don't use module names to load I2C modules
>   vpif_capture: Don't use module names to load I2C modules
>   ivtv: Don't use module names to load I2C modules
>   cx18: Don't use module names to load I2C modules
>   v4l: Remove module_name argument to the v4l2_i2c_new_subdev*
>     functions
> 
>  arch/arm/mach-mx3/mach-pcm037.c               |    2 -
>  arch/arm/mach-mx3/mx31moboard-marxbot.c       |    1 -
>  arch/arm/mach-mx3/mx31moboard-smartbot.c      |    1 -
>  arch/arm/mach-pxa/em-x270.c                   |    1 -
>  arch/arm/mach-pxa/ezx.c                       |    2 -
>  arch/arm/mach-pxa/mioa701.c                   |    1 -
>  arch/arm/mach-pxa/pcm990-baseboard.c          |    2 -
>  arch/sh/boards/mach-ap325rxa/setup.c          |    1 -
>  arch/sh/boards/mach-ecovec24/setup.c          |    4 --
>  arch/sh/boards/mach-kfr2r09/setup.c           |    1 -
>  arch/sh/boards/mach-migor/setup.c             |    2 -
>  arch/sh/boards/mach-se/7724/setup.c           |    1 -
>  drivers/media/radio/radio-si4713.c            |    2 +-
>  drivers/media/video/au0828/au0828-cards.c     |    4 +-
>  drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++-----
>  drivers/media/video/cafe_ccic.c               |    2 +-
>  drivers/media/video/cx18/cx18-i2c.c           |   22 ++---------
>  drivers/media/video/cx231xx/cx231xx-cards.c   |    4 +-
>  drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
>  drivers/media/video/cx23885/cx23885-video.c   |    4 +-
>  drivers/media/video/cx88/cx88-cards.c         |    9 ++--
>  drivers/media/video/cx88/cx88-video.c         |    7 +--
>  drivers/media/video/davinci/vpfe_capture.c    |    1 -
>  drivers/media/video/davinci/vpif_capture.c    |    1 -
>  drivers/media/video/davinci/vpif_display.c    |    2 +-
>  drivers/media/video/em28xx/em28xx-cards.c     |   18 ++++----
>  drivers/media/video/fsl-viu.c                 |    2 +-
>  drivers/media/video/ivtv/ivtv-i2c.c           |   50 +++++--------------------
>  drivers/media/video/mxb.c                     |   12 +++---
>  drivers/media/video/pvrusb2/pvrusb2-hdw.c     |   13 +-----
>  drivers/media/video/saa7134/saa7134-cards.c   |    8 ++--
>  drivers/media/video/saa7134/saa7134-core.c    |    4 +-
>  drivers/media/video/sh_vou.c                  |    2 +-
>  drivers/media/video/soc_camera.c              |    2 +-
>  drivers/media/video/usbvision/usbvision-i2c.c |    6 +-
>  drivers/media/video/v4l2-common.c             |   13 ++----
>  drivers/media/video/vino.c                    |    4 +-
>  drivers/media/video/zoran/zoran.h             |    2 -
>  drivers/media/video/zoran/zoran_card.c        |   24 +----------
>  drivers/staging/go7007/go7007-driver.c        |   43 +--------------------
>  drivers/staging/go7007/go7007-usb.c           |    2 +-
>  drivers/staging/go7007/wis-ov7640.c           |    1 +
>  drivers/staging/go7007/wis-saa7113.c          |    1 +
>  drivers/staging/go7007/wis-saa7115.c          |    1 +
>  drivers/staging/go7007/wis-sony-tuner.c       |    1 +
>  drivers/staging/go7007/wis-tw2804.c           |    1 +
>  drivers/staging/go7007/wis-tw9903.c           |    1 +
>  drivers/staging/go7007/wis-uda1342.c          |    1 +
>  drivers/staging/tm6000/tm6000-cards.c         |    4 +-
>  include/media/sh_vou.h                        |    1 -
>  include/media/v4l2-common.h                   |   16 +++-----
>  51 files changed, 100 insertions(+), 234 deletions(-)
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> 

---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions
  2010-09-24 14:14 ` [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions Laurent Pinchart
@ 2010-10-03 20:07   ` Mike Isely
  0 siblings, 0 replies; 25+ messages in thread
From: Mike Isely @ 2010-10-03 20:07 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, Hans Verkuil, Jean Delvare, Guennadi Liakhovetski,
	Pete Eberlein, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri, Mike Isely at pobox


For just the pvrusb2 part of the patch series below....

Acked-By: Mike Isely <isely@pobox.com>


On Fri, 24 Sep 2010, Laurent Pinchart wrote:

> The argument isn't used anymore by the functions, remote it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/radio/radio-si4713.c            |    2 +-
>  drivers/media/video/au0828/au0828-cards.c     |    4 ++--
>  drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++++++++-----------
>  drivers/media/video/cafe_ccic.c               |    2 +-
>  drivers/media/video/cx18/cx18-i2c.c           |    8 ++++----
>  drivers/media/video/cx231xx/cx231xx-cards.c   |    4 ++--
>  drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
>  drivers/media/video/cx23885/cx23885-video.c   |    4 ++--
>  drivers/media/video/cx88/cx88-cards.c         |    9 ++++-----
>  drivers/media/video/cx88/cx88-video.c         |    7 +++----
>  drivers/media/video/davinci/vpfe_capture.c    |    1 -
>  drivers/media/video/davinci/vpif_capture.c    |    1 -
>  drivers/media/video/davinci/vpif_display.c    |    2 +-
>  drivers/media/video/em28xx/em28xx-cards.c     |   18 +++++++++---------
>  drivers/media/video/fsl-viu.c                 |    2 +-
>  drivers/media/video/ivtv/ivtv-i2c.c           |   22 +++++++++-------------
>  drivers/media/video/mxb.c                     |   12 ++++++------
>  drivers/media/video/pvrusb2/pvrusb2-hdw.c     |    6 ++----
>  drivers/media/video/saa7134/saa7134-cards.c   |    8 ++++----
>  drivers/media/video/saa7134/saa7134-core.c    |    4 ++--
>  drivers/media/video/sh_vou.c                  |    2 +-
>  drivers/media/video/soc_camera.c              |    2 +-
>  drivers/media/video/usbvision/usbvision-i2c.c |    6 +++---
>  drivers/media/video/v4l2-common.c             |   15 +++++----------
>  drivers/media/video/vino.c                    |    4 ++--
>  drivers/media/video/zoran/zoran_card.c        |    5 ++---
>  drivers/staging/go7007/go7007-driver.c        |    2 +-
>  drivers/staging/tm6000/tm6000-cards.c         |    4 ++--
>  include/media/v4l2-common.h                   |   16 ++++++----------
>  29 files changed, 88 insertions(+), 108 deletions(-)
> 
> diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c
> index 045b10f..d49c215 100644
> --- a/drivers/media/radio/radio-si4713.c
> +++ b/drivers/media/radio/radio-si4713.c
> @@ -291,7 +291,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev)
>  		goto unregister_v4l2_dev;
>  	}
>  
> -	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, NULL,
> +	sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter,
>  					pdata->subdev_board_info, NULL);
>  	if (!sd) {
>  		dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n");
> diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c
> index 0453816..01be89f 100644
> --- a/drivers/media/video/au0828/au0828-cards.c
> +++ b/drivers/media/video/au0828/au0828-cards.c
> @@ -212,7 +212,7 @@ void au0828_card_setup(struct au0828_dev *dev)
>  		   be abstracted out if we ever need to support a different
>  		   demod) */
>  		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -				NULL, "au8522", 0x8e >> 1, NULL);
> +				"au8522", 0x8e >> 1, NULL);
>  		if (sd == NULL)
>  			printk(KERN_ERR "analog subdev registration failed\n");
>  	}
> @@ -221,7 +221,7 @@ void au0828_card_setup(struct au0828_dev *dev)
>  	if (dev->board.tuner_type != TUNER_ABSENT) {
>  		/* Load the tuner module, which does the attach */
>  		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -				NULL, "tuner", dev->board.tuner_addr, NULL);
> +				"tuner", dev->board.tuner_addr, NULL);
>  		if (sd == NULL)
>  			printk(KERN_ERR "tuner subdev registration fail\n");
>  
> diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c
> index 87d8b00..49efcf6 100644
> --- a/drivers/media/video/bt8xx/bttv-cards.c
> +++ b/drivers/media/video/bt8xx/bttv-cards.c
> @@ -3529,7 +3529,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  		struct v4l2_subdev *sd;
>  
>  		sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -			&btv->c.i2c_adap, NULL, "saa6588", 0, addrs);
> +			&btv->c.i2c_adap, "saa6588", 0, addrs);
>  		btv->has_saa6588 = (sd != NULL);
>  	}
>  
> @@ -3554,7 +3554,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  		};
>  
>  		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -			&btv->c.i2c_adap, NULL, "msp3400", 0, addrs);
> +			&btv->c.i2c_adap, "msp3400", 0, addrs);
>  		if (btv->sd_msp34xx)
>  			return;
>  		goto no_audio;
> @@ -3568,7 +3568,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  		};
>  
>  		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
> +				&btv->c.i2c_adap, "tda7432", 0, addrs))
>  			return;
>  		goto no_audio;
>  	}
> @@ -3576,7 +3576,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  	case 3: {
>  		/* The user specified that we should probe for tvaudio */
>  		btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -			&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
> +			&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
>  		if (btv->sd_tvaudio)
>  			return;
>  		goto no_audio;
> @@ -3596,11 +3596,11 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  	   found is really something else (e.g. a tea6300). */
>  	if (!bttv_tvcards[btv->c.type].no_msp34xx) {
>  		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -			&btv->c.i2c_adap, NULL, "msp3400",
> +			&btv->c.i2c_adap, "msp3400",
>  			0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1));
>  	} else if (bttv_tvcards[btv->c.type].msp34xx_alt) {
>  		btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -			&btv->c.i2c_adap, NULL, "msp3400",
> +			&btv->c.i2c_adap, "msp3400",
>  			0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1));
>  	}
>  
> @@ -3616,13 +3616,13 @@ void __devinit bttv_init_card2(struct bttv *btv)
>  		};
>  
>  		if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -				&btv->c.i2c_adap, NULL, "tda7432", 0, addrs))
> +				&btv->c.i2c_adap, "tda7432", 0, addrs))
>  			return;
>  	}
>  
>  	/* Now see if we can find one of the tvaudio devices. */
>  	btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -		&btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs());
> +		&btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs());
>  	if (btv->sd_tvaudio)
>  		return;
>  
> @@ -3646,13 +3646,13 @@ void __devinit bttv_init_tuner(struct bttv *btv)
>  		/* Load tuner module before issuing tuner config call! */
>  		if (bttv_tvcards[btv->c.type].has_radio)
>  			v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -				&btv->c.i2c_adap, NULL, "tuner",
> +				&btv->c.i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
>  		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -				&btv->c.i2c_adap, NULL, "tuner",
> +				&btv->c.i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
>  		v4l2_i2c_new_subdev(&btv->c.v4l2_dev,
> -				&btv->c.i2c_adap, NULL, "tuner",
> +				&btv->c.i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD));
>  
>  		tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
> diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
> index 780f3ff..f121610 100644
> --- a/drivers/media/video/cafe_ccic.c
> +++ b/drivers/media/video/cafe_ccic.c
> @@ -2014,7 +2014,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
>  
>  	cam->sensor_addr = 0x42;
>  	cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, &cam->i2c_adapter,
> -			NULL, "ov7670", cam->sensor_addr, NULL);
> +			"ov7670", cam->sensor_addr, NULL);
>  	if (cam->sensor == NULL) {
>  		ret = -ENODEV;
>  		goto out_smbus;
> diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c
> index 3b67984..9ae6915 100644
> --- a/drivers/media/video/cx18/cx18-i2c.c
> +++ b/drivers/media/video/cx18/cx18-i2c.c
> @@ -121,15 +121,15 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
>  	if (hw == CX18_HW_TUNER) {
>  		/* special tuner group handling */
>  		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
> -				adap, NULL, type, 0, cx->card_i2c->radio);
> +				adap, type, 0, cx->card_i2c->radio);
>  		if (sd != NULL)
>  			sd->grp_id = hw;
>  		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
> -				adap, NULL, type, 0, cx->card_i2c->demod);
> +				adap, type, 0, cx->card_i2c->demod);
>  		if (sd != NULL)
>  			sd->grp_id = hw;
>  		sd = v4l2_i2c_new_subdev(&cx->v4l2_dev,
> -				adap, NULL, type, 0, cx->card_i2c->tv);
> +				adap, type, 0, cx->card_i2c->tv);
>  		if (sd != NULL)
>  			sd->grp_id = hw;
>  		return sd != NULL ? 0 : -1;
> @@ -143,7 +143,7 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx)
>  		return -1;
>  
>  	/* It's an I2C device other than an analog tuner or IR chip */
> -	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, NULL, type, hw_addrs[idx],
> +	sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, type, hw_addrs[idx],
>  				 NULL);
>  	if (sd != NULL)
>  		sd->grp_id = hw;
> diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c
> index daaa3b4..129290e 100644
> --- a/drivers/media/video/cx231xx/cx231xx-cards.c
> +++ b/drivers/media/video/cx231xx/cx231xx-cards.c
> @@ -319,7 +319,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
>  	if (dev->board.decoder == CX231XX_AVDECODER) {
>  		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
>  					&dev->i2c_bus[0].i2c_adap,
> -					NULL, "cx25840", 0x88 >> 1, NULL);
> +					"cx25840", 0x88 >> 1, NULL);
>  		if (dev->sd_cx25840 == NULL)
>  			cx231xx_info("cx25840 subdev registration failure\n");
>  		cx25840_call(dev, core, load_fw);
> @@ -329,7 +329,7 @@ void cx231xx_card_setup(struct cx231xx *dev)
>  	if (dev->board.tuner_type != TUNER_ABSENT) {
>  		dev->sd_tuner =	v4l2_i2c_new_subdev(&dev->v4l2_dev,
>  				&dev->i2c_bus[1].i2c_adap,
> -				NULL, "tuner", 0xc2 >> 1, NULL);
> +				"tuner", 0xc2 >> 1, NULL);
>  		if (dev->sd_tuner == NULL)
>  			cx231xx_info("tuner subdev registration failure\n");
>  
> diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c
> index db05400..8861309 100644
> --- a/drivers/media/video/cx23885/cx23885-cards.c
> +++ b/drivers/media/video/cx23885/cx23885-cards.c
> @@ -1247,7 +1247,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)
>  	case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200:
>  		dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
>  				&dev->i2c_bus[2].i2c_adap,
> -				NULL, "cx25840", 0x88 >> 1, NULL);
> +				"cx25840", 0x88 >> 1, NULL);
>  		if (dev->sd_cx25840) {
>  			dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE;
>  			v4l2_subdev_call(dev->sd_cx25840, core, load_fw);
> diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c
> index 4920ddd..d6a87c6 100644
> --- a/drivers/media/video/cx23885/cx23885-video.c
> +++ b/drivers/media/video/cx23885/cx23885-video.c
> @@ -1512,10 +1512,10 @@ int cx23885_video_register(struct cx23885_dev *dev)
>  		if (dev->tuner_addr)
>  			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
>  				&dev->i2c_bus[1].i2c_adap,
> -				NULL, "tuner", dev->tuner_addr, NULL);
> +				"tuner", dev->tuner_addr, NULL);
>  		else
>  			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_bus[1].i2c_adap, NULL,
> +				&dev->i2c_bus[1].i2c_adap,
>  				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV));
>  		if (sd) {
>  			struct tuner_setup tun_setup;
> diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c
> index b0613f7..265f869 100644
> --- a/drivers/media/video/cx88/cx88-cards.c
> +++ b/drivers/media/video/cx88/cx88-cards.c
> @@ -3485,19 +3485,18 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
>  		   later code configures a tea5767.
>  		 */
>  		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
> -				NULL, "tuner",
> -				0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
> +				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO));
>  		if (has_demod)
>  			v4l2_i2c_new_subdev(&core->v4l2_dev,
> -				&core->i2c_adap, NULL, "tuner",
> +				&core->i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
>  		if (core->board.tuner_addr == ADDR_UNSET) {
>  			v4l2_i2c_new_subdev(&core->v4l2_dev,
> -				&core->i2c_adap, NULL, "tuner",
> +				&core->i2c_adap, "tuner",
>  				0, has_demod ? tv_addrs + 4 : tv_addrs);
>  		} else {
>  			v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
> -				NULL, "tuner", core->board.tuner_addr, NULL);
> +				"tuner", core->board.tuner_addr, NULL);
>  		}
>  	}
>  
> diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c
> index f9d1877..154051a 100644
> --- a/drivers/media/video/cx88/cx88-video.c
> +++ b/drivers/media/video/cx88/cx88-video.c
> @@ -1873,14 +1873,13 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
>  
>  	if (core->board.audio_chip == V4L2_IDENT_WM8775)
>  		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
> -				NULL, "wm8775", 0x36 >> 1, NULL);
> +				"wm8775", 0x36 >> 1, NULL);
>  
>  	if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) {
>  		/* This probes for a tda9874 as is used on some
>  		   Pixelview Ultra boards. */
> -		v4l2_i2c_new_subdev(&core->v4l2_dev,
> -				&core->i2c_adap,
> -				NULL, "tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
> +		v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap,
> +				"tvaudio", 0, I2C_ADDRS(0xb0 >> 1));
>  	}
>  
>  	switch (core->boardnr) {
> diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c
> index 5d90fb0..0314bf4 100644
> --- a/drivers/media/video/davinci/vpfe_capture.c
> +++ b/drivers/media/video/davinci/vpfe_capture.c
> @@ -1986,7 +1986,6 @@ static __init int vpfe_probe(struct platform_device *pdev)
>  		vpfe_dev->sd[i] =
>  			v4l2_i2c_new_subdev_board(&vpfe_dev->v4l2_dev,
>  						  i2c_adap,
> -						  NULL,
>  						  &sdinfo->board_info,
>  						  NULL);
>  		if (vpfe_dev->sd[i]) {
> diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c
> index 4b8e70c..0193ffd 100644
> --- a/drivers/media/video/davinci/vpif_capture.c
> +++ b/drivers/media/video/davinci/vpif_capture.c
> @@ -2012,7 +2012,6 @@ static __init int vpif_probe(struct platform_device *pdev)
>  		vpif_obj.sd[i] =
>  			v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
>  						  i2c_adap,
> -						  NULL,
>  						  &subdevdata->board_info,
>  						  NULL);
>  
> diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c
> index 2523a7f..8d156d9 100644
> --- a/drivers/media/video/davinci/vpif_display.c
> +++ b/drivers/media/video/davinci/vpif_display.c
> @@ -1552,7 +1552,7 @@ static __init int vpif_probe(struct platform_device *pdev)
>  
>  	for (i = 0; i < subdev_count; i++) {
>  		vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev,
> -						i2c_adap, NULL,
> +						i2c_adap,
>  						&subdevdata[i].board_info,
>  						NULL);
>  		if (!vpif_obj.sd[i]) {
> diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
> index 7af7860..49feed2 100644
> --- a/drivers/media/video/em28xx/em28xx-cards.c
> +++ b/drivers/media/video/em28xx/em28xx-cards.c
> @@ -2523,39 +2523,39 @@ void em28xx_card_setup(struct em28xx *dev)
>  	/* request some modules */
>  	if (dev->board.has_msp34xx)
>  		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -			NULL, "msp3400", 0, msp3400_addrs);
> +			"msp3400", 0, msp3400_addrs);
>  
>  	if (dev->board.decoder == EM28XX_SAA711X)
>  		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -			NULL, "saa7115_auto", 0, saa711x_addrs);
> +			"saa7115_auto", 0, saa711x_addrs);
>  
>  	if (dev->board.decoder == EM28XX_TVP5150)
>  		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -			NULL, "tvp5150", 0, tvp5150_addrs);
> +			"tvp5150", 0, tvp5150_addrs);
>  
>  	if (dev->em28xx_sensor == EM28XX_MT9V011) {
>  		struct v4l2_subdev *sd;
>  
>  		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -			 &dev->i2c_adap, NULL, "mt9v011", 0, mt9v011_addrs);
> +			 &dev->i2c_adap, "mt9v011", 0, mt9v011_addrs);
>  		v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal);
>  	}
>  
>  
>  	if (dev->board.adecoder == EM28XX_TVAUDIO)
>  		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -			NULL, "tvaudio", dev->board.tvaudio_addr, NULL);
> +			"tvaudio", dev->board.tvaudio_addr, NULL);
>  
>  	if (dev->board.tuner_type != TUNER_ABSENT) {
>  		int has_demod = (dev->tda9887_conf & TDA9887_PRESENT);
>  
>  		if (dev->board.radio.type)
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -				NULL, "tuner", dev->board.radio_addr, NULL);
> +				"tuner", dev->board.radio_addr, NULL);
>  
>  		if (has_demod)
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
>  		if (dev->tuner_addr == 0) {
>  			enum v4l2_i2c_tuner_type type =
> @@ -2563,14 +2563,14 @@ void em28xx_card_setup(struct em28xx *dev)
>  			struct v4l2_subdev *sd;
>  
>  			sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(type));
>  
>  			if (sd)
>  				dev->tuner_addr = v4l2_i2c_subdev_addr(sd);
>  		} else {
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -				NULL, "tuner", dev->tuner_addr, NULL);
> +				"tuner", dev->tuner_addr, NULL);
>  		}
>  	}
>  
> diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c
> index e7f63c1..b0f3f10 100644
> --- a/drivers/media/video/fsl-viu.c
> +++ b/drivers/media/video/fsl-viu.c
> @@ -1485,7 +1485,7 @@ static int __devinit viu_of_probe(struct of_device *op,
>  
>  	ad = i2c_get_adapter(0);
>  	viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad,
> -			NULL, "saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
> +			"saa7113", VIU_VIDEO_DECODER_ADDR, NULL);
>  
>  	viu_dev->vidq.timeout.function = viu_vid_timeout;
>  	viu_dev->vidq.timeout.data     = (unsigned long)viu_dev;
> diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c
> index d104c98..b56d8c0 100644
> --- a/drivers/media/video/ivtv/ivtv-i2c.c
> +++ b/drivers/media/video/ivtv/ivtv-i2c.c
> @@ -238,19 +238,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
>  		return -1;
>  	if (hw == IVTV_HW_TUNER) {
>  		/* special tuner handling */
> -		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
> -				adap, NULL, type,
> -				0, itv->card_i2c->radio);
> +		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
> +				itv->card_i2c->radio);
>  		if (sd)
>  			sd->grp_id = 1 << idx;
> -		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
> -				adap, NULL, type,
> -				0, itv->card_i2c->demod);
> +		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
> +				itv->card_i2c->demod);
>  		if (sd)
>  			sd->grp_id = 1 << idx;
> -		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
> -				adap, NULL, type,
> -				0, itv->card_i2c->tv);
> +		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0,
> +				itv->card_i2c->tv);
>  		if (sd)
>  			sd->grp_id = 1 << idx;
>  		return sd ? 0 : -1;
> @@ -266,17 +263,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx)
>  	/* It's an I2C device other than an analog tuner or IR chip */
>  	if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) {
>  		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
> -				adap, NULL, type, 0, I2C_ADDRS(hw_addrs[idx]));
> +				adap, type, 0, I2C_ADDRS(hw_addrs[idx]));
>  	} else if (hw == IVTV_HW_CX25840) {
>  		struct cx25840_platform_data pdata;
>  
>  		pdata.pvr150_workaround = itv->pvr150_workaround;
>  		sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev,
> -				adap, NULL, type, 0, &pdata, hw_addrs[idx],
> -				NULL);
> +				adap, type, 0, &pdata, hw_addrs[idx], NULL);
>  	} else {
>  		sd = v4l2_i2c_new_subdev(&itv->v4l2_dev,
> -				adap, NULL, type, hw_addrs[idx], NULL);
> +				adap, type, hw_addrs[idx], NULL);
>  	}
>  	if (sd)
>  		sd->grp_id = 1 << idx;
> diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c
> index 4c9c1bb..8104129 100644
> --- a/drivers/media/video/mxb.c
> +++ b/drivers/media/video/mxb.c
> @@ -185,17 +185,17 @@ static int mxb_probe(struct saa7146_dev *dev)
>  	}
>  
>  	mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "saa7111", I2C_SAA7111A, NULL);
> +			"saa7111", I2C_SAA7111A, NULL);
>  	mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "tea6420", I2C_TEA6420_1, NULL);
> +			"tea6420", I2C_TEA6420_1, NULL);
>  	mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "tea6420", I2C_TEA6420_2, NULL);
> +			"tea6420", I2C_TEA6420_2, NULL);
>  	mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "tea6415c", I2C_TEA6415C, NULL);
> +			"tea6415c", I2C_TEA6415C, NULL);
>  	mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "tda9840", I2C_TDA9840, NULL);
> +			"tda9840", I2C_TDA9840, NULL);
>  	mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter,
> -			NULL, "tuner", I2C_TUNER, NULL);
> +			"tuner", I2C_TUNER, NULL);
>  
>  	/* check if all devices are present */
>  	if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c ||
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> index bef2027..66ad516 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> @@ -2088,16 +2088,14 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
>  			   " Setting up with specified i2c address 0x%x",
>  			   mid, i2caddr[0]);
>  		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
> -					 NULL, fname,
> -					 i2caddr[0], NULL);
> +					 fname, i2caddr[0], NULL);
>  	} else {
>  		pvr2_trace(PVR2_TRACE_INIT,
>  			   "Module ID %u:"
>  			   " Setting up with address probe list",
>  			   mid);
>  		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
> -						NULL, fname,
> -						0, i2caddr);
> +					 fname, 0, i2caddr);
>  	}
>  
>  	if (!sd) {
> diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c
> index 10a6cbf..4c69f48 100644
> --- a/drivers/media/video/saa7134/saa7134-cards.c
> +++ b/drivers/media/video/saa7134/saa7134-cards.c
> @@ -7551,22 +7551,22 @@ int saa7134_board_init2(struct saa7134_dev *dev)
>  		   so we do not need to probe for a radio tuner device. */
>  		if (dev->radio_type != UNSET)
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				dev->radio_addr, NULL);
>  		if (has_demod)
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
>  		if (dev->tuner_addr == ADDR_UNSET) {
>  			enum v4l2_i2c_tuner_type type =
>  				has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
>  
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				0, v4l2_i2c_tuner_addrs(type));
>  		} else {
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "tuner",
> +				&dev->i2c_adap, "tuner",
>  				dev->tuner_addr, NULL);
>  		}
>  	}
> diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
> index 2de110f..70469d9 100644
> --- a/drivers/media/video/saa7134/saa7134-core.c
> +++ b/drivers/media/video/saa7134/saa7134-core.c
> @@ -991,7 +991,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
>  	if (card_is_empress(dev)) {
>  		struct v4l2_subdev *sd =
>  			v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -				NULL, "saa6752hs",
> +				"saa6752hs",
>  				saa7134_boards[dev->board].empress_addr, NULL);
>  
>  		if (sd)
> @@ -1002,7 +1002,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
>  		struct v4l2_subdev *sd;
>  
>  		sd = v4l2_i2c_new_subdev(&dev->v4l2_dev,
> -				&dev->i2c_adap, NULL, "saa6588",
> +				&dev->i2c_adap, "saa6588",
>  				0, I2C_ADDRS(saa7134_boards[dev->board].rds_addr));
>  		if (sd) {
>  			printk(KERN_INFO "%s: found RDS decoder\n", dev->name);
> diff --git a/drivers/media/video/sh_vou.c b/drivers/media/video/sh_vou.c
> index 6e35eaa..a3ce9bf 100644
> --- a/drivers/media/video/sh_vou.c
> +++ b/drivers/media/video/sh_vou.c
> @@ -1405,7 +1405,7 @@ static int __devinit sh_vou_probe(struct platform_device *pdev)
>  		goto ereset;
>  
>  	subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap,
> -			NULL, vou_pdata->board_info, NULL);
> +			vou_pdata->board_info, NULL);
>  	if (!subdev) {
>  		ret = -ENOMEM;
>  		goto ei2cnd;
> diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
> index 328cf97..9aa2870 100644
> --- a/drivers/media/video/soc_camera.c
> +++ b/drivers/media/video/soc_camera.c
> @@ -898,7 +898,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd,
>  	icl->board_info->platform_data = icd;
>  
>  	subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap,
> -				NULL, icl->board_info, NULL);
> +				icl->board_info, NULL);
>  	if (!subdev)
>  		goto ei2cnd;
>  
> diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c
> index e3bbae2..81dd53b 100644
> --- a/drivers/media/video/usbvision/usbvision-i2c.c
> +++ b/drivers/media/video/usbvision/usbvision-i2c.c
> @@ -251,7 +251,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
>  		   hit-and-miss. */
>  		mdelay(10);
>  		v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
> -				&usbvision->i2c_adap, NULL,
> +				&usbvision->i2c_adap,
>  				"saa7115_auto", 0, saa711x_addrs);
>  		break;
>  	}
> @@ -261,14 +261,14 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision)
>  		struct tuner_setup tun_setup;
>  
>  		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
> -				&usbvision->i2c_adap, NULL,
> +				&usbvision->i2c_adap,
>  				"tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
>  		/* depending on whether we found a demod or not, select
>  		   the tuner type. */
>  		type = sd ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
>  
>  		sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev,
> -				&usbvision->i2c_adap, NULL,
> +				&usbvision->i2c_adap,
>  				"tuner", 0, v4l2_i2c_tuner_addrs(type));
>  
>  		if (sd == NULL)
> diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c
> index 120b4ac..7a23399 100644
> --- a/drivers/media/video/v4l2-common.c
> +++ b/drivers/media/video/v4l2-common.c
> @@ -368,18 +368,15 @@ EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init);
>  
>  /* Load an i2c sub-device. */
>  struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
> -		struct i2c_adapter *adapter, const char *module_name,
> -		struct i2c_board_info *info, const unsigned short *probe_addrs)
> +		struct i2c_adapter *adapter, struct i2c_board_info *info,
> +		const unsigned short *probe_addrs)
>  {
>  	struct v4l2_subdev *sd = NULL;
>  	struct i2c_client *client;
>  
>  	BUG_ON(!v4l2_dev);
>  
> -	if (module_name)
> -		request_module(module_name);
> -	else
> -		request_module(I2C_MODULE_PREFIX "%s", info->type);
> +	request_module(I2C_MODULE_PREFIX "%s", info->type);
>  
>  	/* Create the i2c client */
>  	if (info->addr == 0 && probe_addrs)
> @@ -431,8 +428,7 @@ error:
>  EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board);
>  
>  struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
> -		struct i2c_adapter *adapter,
> -		const char *module_name, const char *client_type,
> +		struct i2c_adapter *adapter, const char *client_type,
>  		int irq, void *platform_data,
>  		u8 addr, const unsigned short *probe_addrs)
>  {
> @@ -446,8 +442,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
>  	info.irq = irq;
>  	info.platform_data = platform_data;
>  
> -	return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, module_name,
> -			&info, probe_addrs);
> +	return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs);
>  }
>  EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg);
>  
> diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c
> index e5e005d..7e7eec4 100644
> --- a/drivers/media/video/vino.c
> +++ b/drivers/media/video/vino.c
> @@ -4334,10 +4334,10 @@ static int __init vino_module_init(void)
>  
>  	vino_drvdata->decoder =
>  		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
> -			       NULL, "saa7191", 0, I2C_ADDRS(0x45));
> +			       "saa7191", 0, I2C_ADDRS(0x45));
>  	vino_drvdata->camera =
>  		v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter,
> -			       NULL, "indycam", 0, I2C_ADDRS(0x2b));
> +			       "indycam", 0, I2C_ADDRS(0x2b));
>  
>  	dprintk("init complete!\n");
>  
> diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c
> index 0aac376..76179f7 100644
> --- a/drivers/media/video/zoran/zoran_card.c
> +++ b/drivers/media/video/zoran/zoran_card.c
> @@ -1342,13 +1342,12 @@ static int __devinit zoran_probe(struct pci_dev *pdev,
>  	}
>  
>  	zr->decoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
> -		&zr->i2c_adapter, NULL, zr->card.i2c_decoder,
> +		&zr->i2c_adapter, zr->card.i2c_decoder,
>  		0, zr->card.addrs_decoder);
>  
>  	if (zr->card.i2c_encoder)
>  		zr->encoder = v4l2_i2c_new_subdev(&zr->v4l2_dev,
> -			&zr->i2c_adapter,
> -			NULL, zr->card.i2c_encoder,
> +			&zr->i2c_adapter, zr->card.i2c_encoder,
>  			0, zr->card.addrs_encoder);
>  
>  	dprintk(2,
> diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
> index 0a1d925..4e20387 100644
> --- a/drivers/staging/go7007/go7007-driver.c
> +++ b/drivers/staging/go7007/go7007-driver.c
> @@ -199,7 +199,7 @@ static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
>  	struct go7007 *go = i2c_get_adapdata(adapter);
>  	struct v4l2_device *v4l2_dev = &go->v4l2_dev;
>  
> -	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL))
> +	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL))
>  		return 0;
>  
>  	printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
> diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c
> index 1c3b1b6..500a78c 100644
> --- a/drivers/staging/tm6000/tm6000-cards.c
> +++ b/drivers/staging/tm6000/tm6000-cards.c
> @@ -545,7 +545,7 @@ static void tm6000_config_tuner(struct tm6000_core *dev)
>  
>  	/* Load tuner module */
>  	v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -		NULL, "tuner", dev->tuner_addr, NULL);
> +		"tuner", dev->tuner_addr, NULL);
>  
>  	memset(&tun_setup, 0, sizeof(tun_setup));
>  	tun_setup.type = dev->tuner_type;
> @@ -683,7 +683,7 @@ static int tm6000_init_dev(struct tm6000_core *dev)
>  
>  	if (dev->caps.has_tda9874)
>  		v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap,
> -			NULL, "tvaudio", I2C_ADDR_TDA9874, NULL);
> +			"tvaudio", I2C_ADDR_TDA9874, NULL);
>  
>  	/* register and initialize V4L2 */
>  	rc = tm6000_v4l2_register(dev);
> diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
> index 98b3264..4bcda5a 100644
> --- a/include/media/v4l2-common.h
> +++ b/include/media/v4l2-common.h
> @@ -137,31 +137,27 @@ struct v4l2_subdev_ops;
>  
>  
>  /* Load an i2c module and return an initialized v4l2_subdev struct.
> -   Only call request_module if module_name != NULL.
>     The client_type argument is the name of the chip that's on the adapter. */
>  struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev,
> -		struct i2c_adapter *adapter,
> -		const char *module_name, const char *client_type,
> +		struct i2c_adapter *adapter, const char *client_type,
>  		int irq, void *platform_data,
>  		u8 addr, const unsigned short *probe_addrs);
>  
>  /* Load an i2c module and return an initialized v4l2_subdev struct.
> -   Only call request_module if module_name != NULL.
>     The client_type argument is the name of the chip that's on the adapter. */
>  static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev,
> -		struct i2c_adapter *adapter,
> -		const char *module_name, const char *client_type,
> +		struct i2c_adapter *adapter, const char *client_type,
>  		u8 addr, const unsigned short *probe_addrs)
>  {
> -	return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, module_name,
> -				client_type, 0, NULL, addr, probe_addrs);
> +	return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL,
> +				       addr, probe_addrs);
>  }
>  
>  struct i2c_board_info;
>  
>  struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev,
> -		struct i2c_adapter *adapter, const char *module_name,
> -		struct i2c_board_info *info, const unsigned short *probe_addrs);
> +		struct i2c_adapter *adapter, struct i2c_board_info *info,
> +		const unsigned short *probe_addrs);
>  
>  /* Initialize an v4l2_subdev with data from an i2c_client struct */
>  void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client,
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 07/16] pvrusb2: Don't use module names to load I2C modules
  2010-09-24 14:14 ` [PATCH 07/16] pvrusb2: " Laurent Pinchart
@ 2010-10-03 20:07   ` Mike Isely
  0 siblings, 0 replies; 25+ messages in thread
From: Mike Isely @ 2010-10-03 20:07 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: linux-media, Hans Verkuil, Jean Delvare, Guennadi Liakhovetski,
	Pete Eberlein, Eduardo Valentin, Andy Walls, Vaibhav Hiremath,
	Muralidharan Karicheri, Mike Isely at pobox


Acked-By: Mike Isely <isely@pobox.com>

On Fri, 24 Sep 2010, Laurent Pinchart wrote:

> 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 pvrusb2
> driver uses.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/media/video/pvrusb2/pvrusb2-hdw.c |   11 ++---------
>  1 files changed, 2 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> index 70ea578..bef2027 100644
> --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
> @@ -2082,20 +2082,13 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
>  		return -EINVAL;
>  	}
>  
> -	/* Note how the 2nd and 3rd arguments are the same for
> -	 * v4l2_i2c_new_subdev().  Why?
> -	 * Well the 2nd argument is the module name to load, while the 3rd
> -	 * argument is documented in the framework as being the "chipid" -
> -	 * and every other place where I can find examples of this, the
> -	 * "chipid" appears to just be the module name again.  So here we
> -	 * just do the same thing. */
>  	if (i2ccnt == 1) {
>  		pvr2_trace(PVR2_TRACE_INIT,
>  			   "Module ID %u:"
>  			   " Setting up with specified i2c address 0x%x",
>  			   mid, i2caddr[0]);
>  		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
> -					 fname, fname,
> +					 NULL, fname,
>  					 i2caddr[0], NULL);
>  	} else {
>  		pvr2_trace(PVR2_TRACE_INIT,
> @@ -2103,7 +2096,7 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw,
>  			   " Setting up with address probe list",
>  			   mid);
>  		sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap,
> -						fname, fname,
> +						NULL, fname,
>  						0, i2caddr);
>  	}
>  
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/16] Use modaliases to load I2C modules - please review
  2010-09-24 19:00 ` [PATCH 00/16] Use modaliases to load I2C modules - please review Guennadi Liakhovetski
@ 2010-10-05 16:41   ` Guennadi Liakhovetski
  2010-10-05 16:45     ` Jean Delvare
  0 siblings, 1 reply; 25+ messages in thread
From: Guennadi Liakhovetski @ 2010-10-05 16:41 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: Linux Media Mailing List, Hans Verkuil, Jean Delvare,
	Pete Eberlein, Mike Isely, Eduardo Valentin, Andy Walls,
	Vaibhav Hiremath, Muralidharan Karicheri

On Fri, 24 Sep 2010, Guennadi Liakhovetski wrote:

> Hi Laurent
> 
> On Fri, 24 Sep 2010, Laurent Pinchart wrote:
> 
> > Hi everybody,
> > 
> > Here's a bunch of patches (on top of staging/v2.6.37) that remove the
> > module_name argument to the v4l2_i2c_new_subdev* functions.
> 
> Something seems to be wrong with them. On arch/arm/mach-mx3/mach-pcm037.c 
> without your patches both mt9mt031 and mt9v022 drivers attempt to load 
> (only one sensor attached, so, the second one fails probing, but stays 
> loaded, of course), with your patches only one driver loads. As I told 
> you, I'm leaving early tomorrow, so, unfortunately I cannot investigate 
> this further now, please, see if you find the problem, I'll be back on 
> Monday 04.10.

Hm, maybe testing patches between packing and completing a thousand of 
other things was not a very good idea... In any case, I think, it has been 
something in my rootfs. Can it be, that modules, loaded per modalias and 
per explicit module names interact differently with module blacklists? 
That would explain the different behaviour, that I've been observing.

In any case, it seems to work fine with soc-camera. I didn't test sh_vou, 
but I think, it should work too - it looks good at least. If you feel it 
shall be tested, I can do so, maybe, tomorrow, otherwise you can add my

Tested-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

for the "soc-camera: allow only one video queue per device" patch and

Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

for "sh_vou: Don't use module names to load I2C modules"

Thanks
Guennadi

> > 
> > The module name is used by those functions to load the module corresponding
> > to the I2C sub-device being instanciated. As the I2C modules now support
> > modalias (and have been for quite some time), the module name isn't necessary
> > anymore.
> > 
> > The first patch adds the ability to load I2C modules based on modaliases when
> > the module name passed to the v4l_i2c_new_subdev* functions is NULL. This is
> > never the case with the in-tree drivers, so there shouldn't be any regression.
> > 
> > The 14 next patches modify all drivers that call those functions to pass a NULL
> > module name. Patch 2/16 touches all the drivers that hardcode the module name
> > directly when calling the function, and the remaining 13 patches do the same
> > for driver that fetch the module name from platform data or from other sources
> > (such as static tables). I've checked all I2C modules used by the drivers
> > modified in those patches to make sure they have a proper module devices table.
> > 
> > The last patch finally removes the module_name argument, as all callers now
> > pass a NULL value.
> > 
> > The code has obviously not been tested, as I lack the necessary hardware. I've
> > tested the V4L2 core changes with the OMAP3 ISP driver. All x86 drivers have
> > been compile-tested.
> > 
> > Laurent Pinchart (16):
> >   v4l: Load I2C modules based on modalias
> >   v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev*
> >   go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules
> >   go7007: Fix the TW2804 I2C type name
> >   go7007: Don't use module names to load I2C modules
> >   zoran: Don't use module names to load I2C modules
> >   pvrusb2: Don't use module names to load I2C modules
> >   sh_vou: Don't use module names to load I2C modules
> >   radio-si4713: Don't use module names to load I2C modules
> >   soc_camera: Don't use module names to load I2C modules
> >   vpfe_capture: Don't use module names to load I2C modules
> >   vpif_display: Don't use module names to load I2C modules
> >   vpif_capture: Don't use module names to load I2C modules
> >   ivtv: Don't use module names to load I2C modules
> >   cx18: Don't use module names to load I2C modules
> >   v4l: Remove module_name argument to the v4l2_i2c_new_subdev*
> >     functions
> > 
> >  arch/arm/mach-mx3/mach-pcm037.c               |    2 -
> >  arch/arm/mach-mx3/mx31moboard-marxbot.c       |    1 -
> >  arch/arm/mach-mx3/mx31moboard-smartbot.c      |    1 -
> >  arch/arm/mach-pxa/em-x270.c                   |    1 -
> >  arch/arm/mach-pxa/ezx.c                       |    2 -
> >  arch/arm/mach-pxa/mioa701.c                   |    1 -
> >  arch/arm/mach-pxa/pcm990-baseboard.c          |    2 -
> >  arch/sh/boards/mach-ap325rxa/setup.c          |    1 -
> >  arch/sh/boards/mach-ecovec24/setup.c          |    4 --
> >  arch/sh/boards/mach-kfr2r09/setup.c           |    1 -
> >  arch/sh/boards/mach-migor/setup.c             |    2 -
> >  arch/sh/boards/mach-se/7724/setup.c           |    1 -
> >  drivers/media/radio/radio-si4713.c            |    2 +-
> >  drivers/media/video/au0828/au0828-cards.c     |    4 +-
> >  drivers/media/video/bt8xx/bttv-cards.c        |   22 +++++-----
> >  drivers/media/video/cafe_ccic.c               |    2 +-
> >  drivers/media/video/cx18/cx18-i2c.c           |   22 ++---------
> >  drivers/media/video/cx231xx/cx231xx-cards.c   |    4 +-
> >  drivers/media/video/cx23885/cx23885-cards.c   |    2 +-
> >  drivers/media/video/cx23885/cx23885-video.c   |    4 +-
> >  drivers/media/video/cx88/cx88-cards.c         |    9 ++--
> >  drivers/media/video/cx88/cx88-video.c         |    7 +--
> >  drivers/media/video/davinci/vpfe_capture.c    |    1 -
> >  drivers/media/video/davinci/vpif_capture.c    |    1 -
> >  drivers/media/video/davinci/vpif_display.c    |    2 +-
> >  drivers/media/video/em28xx/em28xx-cards.c     |   18 ++++----
> >  drivers/media/video/fsl-viu.c                 |    2 +-
> >  drivers/media/video/ivtv/ivtv-i2c.c           |   50 +++++--------------------
> >  drivers/media/video/mxb.c                     |   12 +++---
> >  drivers/media/video/pvrusb2/pvrusb2-hdw.c     |   13 +-----
> >  drivers/media/video/saa7134/saa7134-cards.c   |    8 ++--
> >  drivers/media/video/saa7134/saa7134-core.c    |    4 +-
> >  drivers/media/video/sh_vou.c                  |    2 +-
> >  drivers/media/video/soc_camera.c              |    2 +-
> >  drivers/media/video/usbvision/usbvision-i2c.c |    6 +-
> >  drivers/media/video/v4l2-common.c             |   13 ++----
> >  drivers/media/video/vino.c                    |    4 +-
> >  drivers/media/video/zoran/zoran.h             |    2 -
> >  drivers/media/video/zoran/zoran_card.c        |   24 +----------
> >  drivers/staging/go7007/go7007-driver.c        |   43 +--------------------
> >  drivers/staging/go7007/go7007-usb.c           |    2 +-
> >  drivers/staging/go7007/wis-ov7640.c           |    1 +
> >  drivers/staging/go7007/wis-saa7113.c          |    1 +
> >  drivers/staging/go7007/wis-saa7115.c          |    1 +
> >  drivers/staging/go7007/wis-sony-tuner.c       |    1 +
> >  drivers/staging/go7007/wis-tw2804.c           |    1 +
> >  drivers/staging/go7007/wis-tw9903.c           |    1 +
> >  drivers/staging/go7007/wis-uda1342.c          |    1 +
> >  drivers/staging/tm6000/tm6000-cards.c         |    4 +-
> >  include/media/sh_vou.h                        |    1 -
> >  include/media/v4l2-common.h                   |   16 +++-----
> >  51 files changed, 100 insertions(+), 234 deletions(-)
> > 
> > -- 
> > Regards,
> > 
> > Laurent Pinchart
> > 
> > 
> 
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
> 

---
Guennadi Liakhovetski

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 00/16] Use modaliases to load I2C modules - please review
  2010-10-05 16:41   ` Guennadi Liakhovetski
@ 2010-10-05 16:45     ` Jean Delvare
  0 siblings, 0 replies; 25+ messages in thread
From: Jean Delvare @ 2010-10-05 16:45 UTC (permalink / raw)
  To: Guennadi Liakhovetski
  Cc: Laurent Pinchart, Linux Media Mailing List, Hans Verkuil,
	Pete Eberlein, Mike Isely, Eduardo Valentin, Andy Walls,
	Vaibhav Hiremath, Muralidharan Karicheri

Hi Guennadi,

On Tue, 5 Oct 2010 18:41:09 +0200 (CEST), Guennadi Liakhovetski wrote:
> Hm, maybe testing patches between packing and completing a thousand of 
> other things was not a very good idea... In any case, I think, it has been 
> something in my rootfs. Can it be, that modules, loaded per modalias and 
> per explicit module names interact differently with module blacklists? 
> That would explain the different behaviour, that I've been observing.

As far as I know, blacklisting only affects alias-based module loading.
Explicit module loading isn't affected by blacklisting.

This is one more good reason to use module aliases where possible,
BTW... Respecting user-defined blacklisting is desirable.

-- 
Jean Delvare

^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules
  2010-09-24 14:14 ` [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules Laurent Pinchart
@ 2010-10-07 16:33   ` Pete Eberlein
  0 siblings, 0 replies; 25+ messages in thread
From: Pete Eberlein @ 2010-10-07 16:33 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Acked-by: Pete Eberlein <pete@sensoray.com>

On Fri, 2010-09-24 at 16:14 +0200, Laurent Pinchart wrote:
> The device table is required to load modules based on modaliases.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/staging/go7007/wis-ov7640.c     |    1 +
>  drivers/staging/go7007/wis-saa7113.c    |    1 +
>  drivers/staging/go7007/wis-saa7115.c    |    1 +
>  drivers/staging/go7007/wis-sony-tuner.c |    1 +
>  drivers/staging/go7007/wis-tw2804.c     |    1 +
>  drivers/staging/go7007/wis-tw9903.c     |    1 +
>  drivers/staging/go7007/wis-uda1342.c    |    1 +
>  7 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/staging/go7007/wis-ov7640.c b/drivers/staging/go7007/wis-ov7640.c
> index 4f0cbdd..6bc9470 100644
> --- a/drivers/staging/go7007/wis-ov7640.c
> +++ b/drivers/staging/go7007/wis-ov7640.c
> @@ -81,6 +81,7 @@ static const struct i2c_device_id wis_ov7640_id[] = {
>  	{ "wis_ov7640", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_ov7640_id);
>  
>  static struct i2c_driver wis_ov7640_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-saa7113.c b/drivers/staging/go7007/wis-saa7113.c
> index 72f5c1f..05e0e10 100644
> --- a/drivers/staging/go7007/wis-saa7113.c
> +++ b/drivers/staging/go7007/wis-saa7113.c
> @@ -308,6 +308,7 @@ static const struct i2c_device_id wis_saa7113_id[] = {
>  	{ "wis_saa7113", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_saa7113_id);
>  
>  static struct i2c_driver wis_saa7113_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-saa7115.c b/drivers/staging/go7007/wis-saa7115.c
> index cd950b6..46cff59 100644
> --- a/drivers/staging/go7007/wis-saa7115.c
> +++ b/drivers/staging/go7007/wis-saa7115.c
> @@ -441,6 +441,7 @@ static const struct i2c_device_id wis_saa7115_id[] = {
>  	{ "wis_saa7115", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_saa7115_id);
>  
>  static struct i2c_driver wis_saa7115_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-sony-tuner.c b/drivers/staging/go7007/wis-sony-tuner.c
> index 981c9b3..8f1b7d4 100644
> --- a/drivers/staging/go7007/wis-sony-tuner.c
> +++ b/drivers/staging/go7007/wis-sony-tuner.c
> @@ -692,6 +692,7 @@ static const struct i2c_device_id wis_sony_tuner_id[] = {
>  	{ "wis_sony_tuner", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_sony_tuner_id);
>  
>  static struct i2c_driver wis_sony_tuner_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-tw2804.c b/drivers/staging/go7007/wis-tw2804.c
> index ee28a99..5b218c5 100644
> --- a/drivers/staging/go7007/wis-tw2804.c
> +++ b/drivers/staging/go7007/wis-tw2804.c
> @@ -331,6 +331,7 @@ static const struct i2c_device_id wis_tw2804_id[] = {
>  	{ "wis_tw2804", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_tw2804_id);
>  
>  static struct i2c_driver wis_tw2804_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-tw9903.c b/drivers/staging/go7007/wis-tw9903.c
> index 80d4726..9230f4a 100644
> --- a/drivers/staging/go7007/wis-tw9903.c
> +++ b/drivers/staging/go7007/wis-tw9903.c
> @@ -313,6 +313,7 @@ static const struct i2c_device_id wis_tw9903_id[] = {
>  	{ "wis_tw9903", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_tw9903_id);
>  
>  static struct i2c_driver wis_tw9903_driver = {
>  	.driver = {
> diff --git a/drivers/staging/go7007/wis-uda1342.c b/drivers/staging/go7007/wis-uda1342.c
> index 5c4eb49..0127be2 100644
> --- a/drivers/staging/go7007/wis-uda1342.c
> +++ b/drivers/staging/go7007/wis-uda1342.c
> @@ -86,6 +86,7 @@ static const struct i2c_device_id wis_uda1342_id[] = {
>  	{ "wis_uda1342", 0 },
>  	{ }
>  };
> +MODULE_DEVICE_TABLE(i2c, wis_uda1342_id);
>  
>  static struct i2c_driver wis_uda1342_driver = {
>  	.driver = {



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 04/16] go7007: Fix the TW2804 I2C type name
  2010-09-24 14:14 ` [PATCH 04/16] go7007: Fix the TW2804 I2C type name Laurent Pinchart
@ 2010-10-07 16:33   ` Pete Eberlein
  0 siblings, 0 replies; 25+ messages in thread
From: Pete Eberlein @ 2010-10-07 16:33 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Acked-by: Pete Eberlein <pete@sensoray.com>

On Fri, 2010-09-24 at 16:14 +0200, Laurent Pinchart wrote:
> The TW2804 I2C sub-device type name was incorrectly set to wis_twTW2804
> for the adlink mpg24 board. Rename it to wis_tw2804.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  drivers/staging/go7007/go7007-usb.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/go7007/go7007-usb.c b/drivers/staging/go7007/go7007-usb.c
> index 20ed930..bea9f4d 100644
> --- a/drivers/staging/go7007/go7007-usb.c
> +++ b/drivers/staging/go7007/go7007-usb.c
> @@ -394,7 +394,7 @@ static struct go7007_usb_board board_adlink_mpg24 = {
>  		.num_i2c_devs	 = 1,
>  		.i2c_devs	 = {
>  			{
> -				.type	= "wis_twTW2804",
> +				.type	= "wis_tw2804",
>  				.id	= I2C_DRIVERID_WIS_TW2804,
>  				.addr	= 0x00, /* yes, really */
>  			},



^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: [PATCH 05/16] go7007: Don't use module names to load I2C modules
  2010-09-24 14:14 ` [PATCH 05/16] go7007: Don't use module names to load I2C modules Laurent Pinchart
@ 2010-10-07 16:33   ` Pete Eberlein
  0 siblings, 0 replies; 25+ messages in thread
From: Pete Eberlein @ 2010-10-07 16:33 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

Acked-by: Pete Eberlein <pete@sensoray.com>

On Fri, 2010-09-24 at 16:14 +0200, Laurent Pinchart wrote:
> 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>
> ---
>  drivers/staging/go7007/go7007-driver.c |   43 ++-----------------------------
>  1 files changed, 3 insertions(+), 40 deletions(-)
> 
> diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c
> index 372a7c6..0a1d925 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)
>   * Attempt to instantiate an I2C client by ID, probably loading a module.
>   */
>  static int init_i2c_module(struct i2c_adapter *adapter, const char *type,
> -			   int id, int addr)
> +			   int addr)
>  {
>  	struct go7007 *go = i2c_get_adapdata(adapter);
>  	struct v4l2_device *v4l2_dev = &go->v4l2_dev;
> -	char *modname;
>  
> -	switch (id) {
> -	case I2C_DRIVERID_WIS_SAA7115:
> -		modname = "wis-saa7115";
> -		break;
> -	case I2C_DRIVERID_WIS_SAA7113:
> -		modname = "wis-saa7113";
> -		break;
> -	case I2C_DRIVERID_WIS_UDA1342:
> -		modname = "wis-uda1342";
> -		break;
> -	case I2C_DRIVERID_WIS_SONY_TUNER:
> -		modname = "wis-sony-tuner";
> -		break;
> -	case I2C_DRIVERID_WIS_TW9903:
> -		modname = "wis-tw9903";
> -		break;
> -	case I2C_DRIVERID_WIS_TW2804:
> -		modname = "wis-tw2804";
> -		break;
> -	case I2C_DRIVERID_WIS_OV7640:
> -		modname = "wis-ov7640";
> -		break;
> -	case I2C_DRIVERID_S2250:
> -		modname = "s2250";
> -		break;
> -	default:
> -		modname = NULL;
> -		break;
> -	}
> -
> -	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, modname, type, addr, NULL))
> +	if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL))
>  		return 0;
>  
> -	if (modname != NULL)
> -		printk(KERN_INFO
> -			"go7007: probing for module %s failed\n", modname);
> -	else
> -		printk(KERN_INFO
> -			"go7007: sensor %u seems to be unsupported!\n", id);
> +	printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type);
>  	return -1;
>  }
>  
> @@ -277,7 +241,6 @@ int go7007_register_encoder(struct go7007 *go)
>  		for (i = 0; i < go->board_info->num_i2c_devs; ++i)
>  			init_i2c_module(&go->i2c_adapter,
>  					go->board_info->i2c_devs[i].type,
> -					go->board_info->i2c_devs[i].id,
>  					go->board_info->i2c_devs[i].addr);
>  		if (go->board_id == GO7007_BOARDID_ADLINK_MPG24)
>  			i2c_clients_command(&go->i2c_adapter,



^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2010-10-07 16:42 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-24 14:13 [PATCH 00/16] Use modaliases to load I2C modules - please review Laurent Pinchart
2010-09-24 14:13 ` [PATCH 01/16] v4l: Load I2C modules based on modalias Laurent Pinchart
2010-09-24 14:14 ` [PATCH 02/16] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev* Laurent Pinchart
2010-09-24 14:14 ` [PATCH 03/16] go7007: Add MODULE_DEVICE_TABLE to the go7007 I2C modules Laurent Pinchart
2010-10-07 16:33   ` Pete Eberlein
2010-09-24 14:14 ` [PATCH 04/16] go7007: Fix the TW2804 I2C type name Laurent Pinchart
2010-10-07 16:33   ` Pete Eberlein
2010-09-24 14:14 ` [PATCH 05/16] go7007: Don't use module names to load I2C modules Laurent Pinchart
2010-10-07 16:33   ` Pete Eberlein
2010-09-24 14:14 ` [PATCH 06/16] zoran: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 07/16] pvrusb2: " Laurent Pinchart
2010-10-03 20:07   ` Mike Isely
2010-09-24 14:14 ` [PATCH 08/16] sh_vou: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 09/16] radio-si4713: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 10/16] soc_camera: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 11/16] vpfe_capture: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 12/16] vpif_display: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 13/16] vpif_capture: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 14/16] ivtv: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 15/16] cx18: " Laurent Pinchart
2010-09-24 14:14 ` [PATCH 16/16] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions Laurent Pinchart
2010-10-03 20:07   ` Mike Isely
2010-09-24 19:00 ` [PATCH 00/16] Use modaliases to load I2C modules - please review Guennadi Liakhovetski
2010-10-05 16:41   ` Guennadi Liakhovetski
2010-10-05 16:45     ` Jean Delvare

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox