Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Mauro Carvalho Chehab <m.chehab@samsung.com>,
	linux-media@vger.kernel.org
Subject: Re: [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice
Date: Wed, 28 May 2014 13:16:40 +0200	[thread overview]
Message-ID: <14598510.Vt3YXH2eJa@avalon> (raw)
In-Reply-To: <1401112645-14884-1-git-send-email-p.zabel@pengutronix.de>

Hi Philipp,

Thank you for the patch.

On Monday 26 May 2014 15:57:25 Philipp Zabel wrote:
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Now that Mauro starts to enforce commit message, I'll need to ask you to 
provide one :-)

> ---
>  drivers/media/i2c/mt9v032.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
> index 29d8d8f..ded97c2 100644
> --- a/drivers/media/i2c/mt9v032.c
> +++ b/drivers/media/i2c/mt9v032.c
> @@ -985,6 +985,11 @@ static int mt9v032_probe(struct i2c_client *client,
> 
>  	mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE;
>  	ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad, 0);
> +	if (ret < 0)
> +		return ret;

That's not correct. You need to free the control handler here.

> +
> +	mt9v032->subdev.dev = &client->dev;
> +	ret = v4l2_async_register_subdev(&mt9v032->subdev);

Don't you also need to call v4l2_async_unregister_subdev() in the remove 
function ?

> 
>  	if (ret < 0)
>  		v4l2_ctrl_handler_free(&mt9v032->ctrls);

And you need to cleanup the media entity here. A dedicated error code block at 
the end of the function with appropriate goto statements seems to be needed.

-- 
Regards,

Laurent Pinchart


  reply	other threads:[~2014-05-28 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-26 13:57 [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice Philipp Zabel
2014-05-28 11:16 ` Laurent Pinchart [this message]
2014-05-28 14:10   ` Philipp Zabel

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=14598510.Vt3YXH2eJa@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.chehab@samsung.com \
    --cc=p.zabel@pengutronix.de \
    /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