mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>,
	LMML <linux-media@vger.kernel.org>,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	DLOS <davinci-linux-open-source@linux.davincidsp.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH] media: i2c: tvp514x: add support for asynchronous probing
Date: Sun, 23 Jun 2013 17:19:09 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.64.1306231716050.13783@axis700.grange> (raw)
In-Reply-To: <1371896189-5475-1-git-send-email-prabhakar.csengg@gmail.com>

On Sat, 22 Jun 2013, Prabhakar Lad wrote:

> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
> 
> Both synchronous and asynchronous tvp514x subdevice probing is supported by
> this patch.
> 
> Signed-off-by: Prabhakar Lad <prabhakar.csengg@gmail.com>
> Cc: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Cc: Hans Verkuil <hverkuil@xs4all.nl>
> Cc: Sakari Ailus <sakari.ailus@iki.fi>
> Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
> ---
>  drivers/media/i2c/tvp514x.c |   22 +++++++++++++++-------
>  1 file changed, 15 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/media/i2c/tvp514x.c b/drivers/media/i2c/tvp514x.c
> index 864eb14..d090caf 100644
> --- a/drivers/media/i2c/tvp514x.c
> +++ b/drivers/media/i2c/tvp514x.c
> @@ -36,6 +36,7 @@
>  #include <linux/module.h>
>  #include <linux/v4l2-mediabus.h>
>  
> +#include <media/v4l2-async.h>
>  #include <media/v4l2-device.h>
>  #include <media/v4l2-common.h>
>  #include <media/v4l2-mediabus.h>

Ok, but this one really does too many things in one patch:

> @@ -1148,9 +1149,9 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	/* Register with V4L2 layer as slave device */
>  	sd = &decoder->sd;
>  	v4l2_i2c_subdev_init(sd, client, &tvp514x_ops);
> -	strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));
>  
>  #if defined(CONFIG_MEDIA_CONTROLLER)
> +	strlcpy(sd->name, TVP514X_MODULE_NAME, sizeof(sd->name));

This is unrelated

>  	decoder->pad.flags = MEDIA_PAD_FL_SOURCE;
>  	decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
>  	decoder->sd.entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
> @@ -1176,16 +1177,22 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
>  	sd->ctrl_handler = &decoder->hdl;
>  	if (decoder->hdl.error) {
>  		ret = decoder->hdl.error;
> -
> -		v4l2_ctrl_handler_free(&decoder->hdl);
> -		return ret;
> +		goto done;
>  	}
>  	v4l2_ctrl_handler_setup(&decoder->hdl);
>  
> -	v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
> -
> -	return 0;
> +	ret = v4l2_async_register_subdev(&decoder->sd);
> +	if (!ret)
> +		v4l2_info(sd, "%s decoder driver registered !!\n", sd->name);
>  
> +done:
> +	if (ret < 0) {
> +		v4l2_ctrl_handler_free(&decoder->hdl);
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> +		media_entity_cleanup(&decoder->sd.entity);

So is this - it wasn't called before in the "if (decoder->hdl.error)" case 
above.

Thanks
Guennadi

> +#endif
> +	}
> +	return ret;
>  }
>  
>  /**
> @@ -1200,6 +1207,7 @@ static int tvp514x_remove(struct i2c_client *client)
>  	struct v4l2_subdev *sd = i2c_get_clientdata(client);
>  	struct tvp514x_decoder *decoder = to_decoder(sd);
>  
> +	v4l2_async_unregister_subdev(&decoder->sd);
>  	v4l2_device_unregister_subdev(sd);
>  #if defined(CONFIG_MEDIA_CONTROLLER)
>  	media_entity_cleanup(&decoder->sd.entity);
> -- 
> 1.7.9.5
> 

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

  reply	other threads:[~2013-06-23 15:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-22 10:16 Prabhakar Lad
2013-06-23 15:19 ` Guennadi Liakhovetski [this message]
2013-06-23 15:48   ` Prabhakar Lad
2013-06-24  7:11     ` Hans Verkuil
2013-06-24  8:24       ` Prabhakar Lad
2013-06-24  8:39         ` Hans Verkuil
2013-06-24  8:53           ` Prabhakar Lad
2013-06-24  8:55             ` Hans Verkuil

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=Pine.LNX.4.64.1306231716050.13783@axis700.grange \
    --to=g.liakhovetski@gmx.de \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@redhat.com \
    --cc=prabhakar.csengg@gmail.com \
    --cc=sakari.ailus@iki.fi \
    /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

all inboxes | Powered by JetHome®