linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Linux Media Mailing List <linux-media@vger.kernel.org>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Prabhakar Lad <prabhakar.csengg@gmail.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Boris BREZILLON <boris.brezillon@free-electrons.com>
Subject: Re: [PATCH 2/7] cx25840: fill the media controller entity
Date: Sat, 03 Jan 2015 16:13:37 -0800	[thread overview]
Message-ID: <1420330417.2619.1.camel@perches.com> (raw)
In-Reply-To: <487a406afc2d79b2027f1d9667dfad4a716ed630.1420315245.git.mchehab@osg.samsung.com>

On Sat, 2015-01-03 at 18:09 -0200, Mauro Carvalho Chehab wrote:
> Instead of keeping the media controller entity not initialized,
> fill it and create the pads for cx25840.

Won't you get an unused variable for ret
without CONFIG_MEDIA_CONTROLLER?

> diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c
[]
> @@ -5134,7 +5134,7 @@ static int cx25840_probe(struct i2c_client *client,
>  {
>  	struct cx25840_state *state;
>  	struct v4l2_subdev *sd;
> -	int default_volume;
> +	int default_volume, ret;
>  	u32 id;
>  	u16 device_id;
>  
> @@ -5178,6 +5178,18 @@ static int cx25840_probe(struct i2c_client *client,
>  
>  	sd = &state->sd;
>  	v4l2_i2c_subdev_init(sd, client, &cx25840_ops);
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> +	/* TODO: need to represent analog inputs too */
> +	state->pads[0].flags = MEDIA_PAD_FL_SINK;	/* Tuner or input */
> +	state->pads[1].flags = MEDIA_PAD_FL_SOURCE;	/* Video */
> +	state->pads[2].flags = MEDIA_PAD_FL_SOURCE;	/* VBI */
> +	sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
> +
> +	ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
> +				state->pads, 0);
> +	if (ret < 0)
> +		v4l_info(client, "failed to initialize media entity!\n");
> +#endif
>  
>  	switch (id) {
>  	case CX23885_AV:

Maybe write this without ret at all.

	if (media_entry_init(...) < 0)
		v4l_info(...)



  reply	other threads:[~2015-01-04  0:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-03 20:09 [PATCH 0/7] add link graph to cx231xx using the media controller Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 1/7] tuner-core: properly initialize media controller subdev Mauro Carvalho Chehab
2015-01-04  0:39   ` Sakari Ailus
2015-01-11 14:02   ` Laurent Pinchart
2015-01-11 14:25     ` Mauro Carvalho Chehab
2015-01-13 16:35       ` Antti Palosaari
2015-01-03 20:09 ` [PATCH 2/7] cx25840: fill the media controller entity Mauro Carvalho Chehab
2015-01-04  0:13   ` Joe Perches [this message]
2015-01-03 20:09 ` [PATCH 3/7] cx231xx: initialize video/vbi pads Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 4/7] cx231xx: create media links for analog mode Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 5/7] dvbdev: represent frontend with two pads Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 6/7] dvbdev: add a function to create DVB media graph Mauro Carvalho Chehab
2015-01-03 20:09 ` [PATCH 7/7] cx231xx: create DVB graph Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420330417.2619.1.camel@perches.com \
    --to=joe@perches.com \
    --cc=boris.brezillon@free-electrons.com \
    --cc=hans.verkuil@cisco.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=mchehab@osg.samsung.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).