From: Sakari Ailus <sakari.ailus@iki.fi>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org,
Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>,
Songjun Wu <songjun.wu@microchip.com>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH 02/15] ov7670: call v4l2_async_register_subdev
Date: Mon, 19 Dec 2016 00:08:09 +0200 [thread overview]
Message-ID: <20161218220809.GV16630@valkosipuli.retiisi.org.uk> (raw)
In-Reply-To: <20161212155520.41375-3-hverkuil@xs4all.nl>
On Mon, Dec 12, 2016 at 04:55:07PM +0100, Hans Verkuil wrote:
> From: Hans Verkuil <hans.verkuil@cisco.com>
>
> Add v4l2-async support for this driver.
>
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
> ---
> drivers/media/i2c/ov7670.c | 21 +++++++++++++++------
> 1 file changed, 15 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/media/i2c/ov7670.c b/drivers/media/i2c/ov7670.c
> index b0315bb..3f0522f 100644
> --- a/drivers/media/i2c/ov7670.c
> +++ b/drivers/media/i2c/ov7670.c
> @@ -1641,18 +1641,15 @@ static int ov7670_probe(struct i2c_client *client,
> if (info->hdl.error) {
> int err = info->hdl.error;
>
> - v4l2_ctrl_handler_free(&info->hdl);
> - return err;
> + goto fail;
> }
>
> #if defined(CONFIG_MEDIA_CONTROLLER)
> info->pad.flags = MEDIA_PAD_FL_SOURCE;
> info->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
> ret = media_entity_pads_init(&info->sd.entity, 1, &info->pad);
> - if (ret < 0) {
> - v4l2_ctrl_handler_free(&info->hdl);
> - return ret;
> - }
> + if (ret < 0)
> + goto fail;
> #endif
> /*
> * We have checked empirically that hw allows to read back the gain
> @@ -1664,7 +1661,19 @@ static int ov7670_probe(struct i2c_client *client,
> v4l2_ctrl_cluster(2, &info->saturation);
> v4l2_ctrl_handler_setup(&info->hdl);
>
> + ret = v4l2_async_register_subdev(&info->sd);
> + if (ret < 0) {
> +#if defined(CONFIG_MEDIA_CONTROLLER)
> + media_entity_cleanup(&info->sd.entity);
I think it'd be cleaner if you added another label for this. Up to you.
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> +#endif
> + goto fail;
> + }
> +
> return 0;
> +
> +fail:
> + v4l2_ctrl_handler_free(&info->hdl);
> + return ret;
> }
>
>
--
Sakari Ailus
e-mail: sakari.ailus@iki.fi XMPP: sailus@retiisi.org.uk
next prev parent reply other threads:[~2016-12-18 22:08 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-12 15:55 [PATCH 00/15] atmel-isi/ov7670/ov2640: convert to standalone drivers Hans Verkuil
2016-12-12 15:55 ` [PATCH 01/15] ov7670: add media controller support Hans Verkuil
2016-12-18 22:07 ` Sakari Ailus
2016-12-12 15:55 ` [PATCH 02/15] ov7670: call v4l2_async_register_subdev Hans Verkuil
2016-12-18 22:08 ` Sakari Ailus [this message]
2017-01-02 13:09 ` Hans Verkuil
2016-12-12 15:55 ` [PATCH 03/15] ov7670: fix g/s_parm Hans Verkuil
2016-12-12 15:55 ` [PATCH 04/15] ov7670: get xclk Hans Verkuil
2016-12-18 22:15 ` Sakari Ailus
2017-01-02 13:18 ` Hans Verkuil
2016-12-12 15:55 ` [PATCH 05/15] ov7670: add devicetree support Hans Verkuil
2016-12-12 15:55 ` [PATCH 06/15] ov7670: document device tree bindings Hans Verkuil
2016-12-12 15:55 ` [PATCH 07/15] atmel-isi: remove dependency of the soc-camera framework Hans Verkuil
2016-12-12 15:55 ` [PATCH 08/15] atmel-isi: move out of soc_camera to atmel Hans Verkuil
2016-12-12 15:55 ` [PATCH 09/15] atmel-isi: document device tree bindings Hans Verkuil
2016-12-12 15:55 ` [PATCH 10/15] ov2640: convert from soc-camera to a standard subdev sensor driver Hans Verkuil
2016-12-12 15:55 ` [PATCH 11/15] ov2640: enable clock, fix power/reset and add MC support Hans Verkuil
2016-12-12 15:55 ` [PATCH 12/15] ov2640 bindings update Hans Verkuil
2016-12-12 15:55 ` [PATCH 13/15] em28xx: drop last soc_camera link Hans Verkuil
2016-12-12 15:55 ` [PATCH 14/15] sama5d3 dts: enable atmel-isi Hans Verkuil
2016-12-12 15:55 ` [PATCH 15/15] at91-sama5d3_xplained.dts: select ov2640 Hans Verkuil
2016-12-18 22:10 ` [PATCH 00/15] atmel-isi/ov7670/ov2640: convert to standalone drivers Sakari Ailus
2017-01-02 13:37 ` Hans Verkuil
2017-01-02 13:41 ` Hans Verkuil
2017-01-02 21:09 ` Sakari Ailus
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=20161218220809.GV16630@valkosipuli.retiisi.org.uk \
--to=sakari.ailus@iki.fi \
--cc=guennadi.liakhovetski@intel.com \
--cc=hans.verkuil@cisco.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=songjun.wu@microchip.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).