linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] v4l: vsp1: sru: Handle control handler initialization errors
@ 2014-05-26 22:46 Laurent Pinchart
  2014-05-27 13:29 ` Sakari Ailus
  0 siblings, 1 reply; 2+ messages in thread
From: Laurent Pinchart @ 2014-05-26 22:46 UTC (permalink / raw)
  To: linux-media

Bail out when the SRU control handler fails to initialize.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/platform/vsp1/vsp1_sru.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c
index aa0e04c..79efcaf 100644
--- a/drivers/media/platform/vsp1/vsp1_sru.c
+++ b/drivers/media/platform/vsp1/vsp1_sru.c
@@ -348,6 +348,14 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device *vsp1)
 	/* Initialize the control handler. */
 	v4l2_ctrl_handler_init(&sru->ctrls, 1);
 	v4l2_ctrl_new_custom(&sru->ctrls, &sru_intensity_control, NULL);
+
+	if (sru->ctrls.error) {
+		dev_err(vsp1->dev, "sru: failed to initialize controls\n");
+		ret = sru->ctrls.error;
+		v4l2_ctrl_handler_free(&sru->ctrls);
+		return ERR_PTR(ret);
+	}
+
 	v4l2_ctrl_handler_setup(&sru->ctrls);
 	sru->entity.subdev.ctrl_handler = &sru->ctrls;
 
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] v4l: vsp1: sru: Handle control handler initialization errors
  2014-05-26 22:46 [PATCH] v4l: vsp1: sru: Handle control handler initialization errors Laurent Pinchart
@ 2014-05-27 13:29 ` Sakari Ailus
  0 siblings, 0 replies; 2+ messages in thread
From: Sakari Ailus @ 2014-05-27 13:29 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media

On Tue, May 27, 2014 at 12:46:49AM +0200, Laurent Pinchart wrote:
> Bail out when the SRU control handler fails to initialize.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/media/platform/vsp1/vsp1_sru.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_sru.c b/drivers/media/platform/vsp1/vsp1_sru.c
> index aa0e04c..79efcaf 100644
> --- a/drivers/media/platform/vsp1/vsp1_sru.c
> +++ b/drivers/media/platform/vsp1/vsp1_sru.c
> @@ -348,6 +348,14 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device *vsp1)
>  	/* Initialize the control handler. */
>  	v4l2_ctrl_handler_init(&sru->ctrls, 1);
>  	v4l2_ctrl_new_custom(&sru->ctrls, &sru_intensity_control, NULL);
> +
> +	if (sru->ctrls.error) {
> +		dev_err(vsp1->dev, "sru: failed to initialize controls\n");
> +		ret = sru->ctrls.error;
> +		v4l2_ctrl_handler_free(&sru->ctrls);
> +		return ERR_PTR(ret);
> +	}
> +
>  	v4l2_ctrl_handler_setup(&sru->ctrls);
>  	sru->entity.subdev.ctrl_handler = &sru->ctrls;
>  

Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>

-- 
Sakari Ailus
e-mail: sakari.ailus@iki.fi	XMPP: sailus@retiisi.org.uk

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-05-27 13:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-26 22:46 [PATCH] v4l: vsp1: sru: Handle control handler initialization errors Laurent Pinchart
2014-05-27 13:29 ` Sakari Ailus

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).