* [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice
@ 2014-05-26 13:57 Philipp Zabel
2014-05-28 11:16 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Philipp Zabel @ 2014-05-26 13:57 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Mauro Carvalho Chehab, linux-media, Philipp Zabel
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
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;
+
+ mt9v032->subdev.dev = &client->dev;
+ ret = v4l2_async_register_subdev(&mt9v032->subdev);
if (ret < 0)
v4l2_ctrl_handler_free(&mt9v032->ctrls);
--
2.0.0.rc2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice
2014-05-26 13:57 [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice Philipp Zabel
@ 2014-05-28 11:16 ` Laurent Pinchart
2014-05-28 14:10 ` Philipp Zabel
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2014-05-28 11:16 UTC (permalink / raw)
To: Philipp Zabel; +Cc: Mauro Carvalho Chehab, linux-media
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice
2014-05-28 11:16 ` Laurent Pinchart
@ 2014-05-28 14:10 ` Philipp Zabel
0 siblings, 0 replies; 3+ messages in thread
From: Philipp Zabel @ 2014-05-28 14:10 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: Mauro Carvalho Chehab, linux-media
Hi Laurent,
Am Mittwoch, den 28.05.2014, 13:16 +0200 schrieb Laurent Pinchart:
> 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 :-)
My bad, I'll fix this up as you suggest and add a commit message.
> > ---
> > 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
Philipp
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-28 14:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-26 13:57 [PATCH] [media] mt9v032: register v4l2 asynchronous subdevice Philipp Zabel
2014-05-28 11:16 ` Laurent Pinchart
2014-05-28 14:10 ` Philipp Zabel
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).