All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] mt9t001: fix clean up in case of power-on failures
Date: Mon, 14 Dec 2015 22:41:05 +0200	[thread overview]
Message-ID: <2084612.aRddVu4fsx@avalon> (raw)
In-Reply-To: <Pine.LNX.4.64.1512141049310.11891@axis700.grange>

Hi Guennadi,

Thank you for the patch.

On Monday 14 December 2015 10:58:29 Guennadi Liakhovetski wrote:
> If the driver fails to reset the camera or to set up control handlers, it
> has to power the camera back off.
> 
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

and applied to my tree.

> ---
>  drivers/media/i2c/mt9t001.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9t001.c b/drivers/media/i2c/mt9t001.c
> index 8ae99f7..f262cf2 100644
> --- a/drivers/media/i2c/mt9t001.c
> +++ b/drivers/media/i2c/mt9t001.c
> @@ -233,10 +233,21 @@ static int __mt9t001_set_power(struct mt9t001
> *mt9t001, bool on) ret = mt9t001_reset(mt9t001);
>  	if (ret < 0) {
>  		dev_err(&client->dev, "Failed to reset the camera\n");
> -		return ret;
> +		goto e_power;
>  	}
> 
> -	return v4l2_ctrl_handler_setup(&mt9t001->ctrls);
> +	ret = v4l2_ctrl_handler_setup(&mt9t001->ctrls);
> +	if (ret < 0) {
> +		dev_err(&client->dev, "Failed to set up control handlers\n");
> +		goto e_power;
> +	}
> +
> +	return 0;
> +
> +e_power:
> +	mt9t001_power_off(mt9t001);
> +
> +	return ret;
>  }
> 
>  /*
> ---------------------------------------------------------------------------
> --

-- 
Regards,

Laurent Pinchart


      reply	other threads:[~2015-12-14 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-14  9:58 [PATCH] mt9t001: fix clean up in case of power-on failures Guennadi Liakhovetski
2015-12-14 20:41 ` Laurent Pinchart [this message]

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=2084612.aRddVu4fsx@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=linux-media@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.