[08/11,media] cx231xx: use v4l2 core function to create the MC graph
diff mbox

Message ID b4a6cd80d5561da2c87677815dd1e0001ca8a8a4.1455269986.git.mchehab@osg.samsung.com
State New
Headers show

Commit Message

Mauro Carvalho Chehab Feb. 12, 2016, 9:45 a.m. UTC
Instead of having its own routine, use the one defined at the
core, as it is generic enough to handle the cx231xx usecases.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
---
 drivers/media/usb/cx231xx/cx231xx-cards.c | 47 +------------------------------
 1 file changed, 1 insertion(+), 46 deletions(-)

Comments

kbuild test robot Feb. 12, 2016, 10:40 a.m. UTC | #1
Hi Mauro,

[auto build test ERROR on linuxtv-media/master]
[cannot apply to v4.5-rc3 next-20160212]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]

url:    https://github.com/0day-ci/linux/commits/Mauro-Carvalho-Chehab/Some-improvements-fixes/20160212-174848
base:   git://linuxtv.org/media_tree.git master
config: x86_64-rhel (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/media/usb/cx231xx/cx231xx-cards.c: In function 'cx231xx_usb_probe':
>> drivers/media/usb/cx231xx/cx231xx-cards.c:1687:41: error: 'struct cx231xx' has no member named 'media_dev'
     retval = v4l2_mc_create_media_graph(dev->media_dev);
                                            ^

vim +1687 drivers/media/usb/cx231xx/cx231xx-cards.c

  1681		if (dev->model == CX231XX_BOARD_CNXT_RDE_253S)
  1682			cx231xx_sleep_s5h1432(dev);
  1683	
  1684		/* load other modules required */
  1685		request_modules(dev);
  1686	
> 1687		retval = v4l2_mc_create_media_graph(dev->media_dev);
  1688		if (retval < 0)
  1689			goto done;
  1690	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Patch
diff mbox

diff --git a/drivers/media/usb/cx231xx/cx231xx-cards.c b/drivers/media/usb/cx231xx/cx231xx-cards.c
index a8d0655f7250..0b8b5011f80e 100644
--- a/drivers/media/usb/cx231xx/cx231xx-cards.c
+++ b/drivers/media/usb/cx231xx/cx231xx-cards.c
@@ -1221,51 +1221,6 @@  static int cx231xx_media_device_init(struct cx231xx *dev,
 	return 0;
 }
 
-static int cx231xx_create_media_graph(struct cx231xx *dev)
-{
-#ifdef CONFIG_MEDIA_CONTROLLER
-	struct media_device *mdev = dev->media_dev;
-	struct media_entity *entity;
-	struct media_entity *tuner = NULL, *decoder = NULL;
-	int ret;
-
-	if (!mdev)
-		return 0;
-
-	media_device_for_each_entity(entity, mdev) {
-		switch (entity->function) {
-		case MEDIA_ENT_F_TUNER:
-			tuner = entity;
-			break;
-		case MEDIA_ENT_F_ATV_DECODER:
-			decoder = entity;
-			break;
-		}
-	}
-
-	/* Analog setup, using tuner as a link */
-
-	if (!decoder)
-		return 0;
-
-	if (tuner) {
-		ret = media_create_pad_link(tuner, TUNER_PAD_OUTPUT, decoder, 0,
-					    MEDIA_LNK_FL_ENABLED);
-		if (ret < 0)
-			return ret;
-	}
-	ret = media_create_pad_link(decoder, 1, &dev->vdev.entity, 0,
-				    MEDIA_LNK_FL_ENABLED);
-	if (ret < 0)
-		return ret;
-	ret = media_create_pad_link(decoder, 2, &dev->vbi_dev.entity, 0,
-				    MEDIA_LNK_FL_ENABLED);
-	if (ret < 0)
-		return ret;
-#endif
-	return 0;
-}
-
 /*
  * cx231xx_init_dev()
  * allocates and inits the device structs, registers i2c bus and v4l device
@@ -1729,7 +1684,7 @@  static int cx231xx_usb_probe(struct usb_interface *interface,
 	/* load other modules required */
 	request_modules(dev);
 
-	retval = cx231xx_create_media_graph(dev);
+	retval = v4l2_mc_create_media_graph(dev->media_dev);
 	if (retval < 0)
 		goto done;