public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Prabhakar Lad <prabhakar.csengg@gmail.com>
Cc: LMML <linux-media@vger.kernel.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] media: i2c: mt9v032: Check return value of clk_prepare_enable/clk_set_rate
Date: Sun, 19 Jan 2014 21:05:34 +0100	[thread overview]
Message-ID: <2157121.3izth3cqlo@avalon> (raw)
In-Reply-To: <1389950567-32577-1-git-send-email-prabhakar.csengg@gmail.com>

Hi Prabhakar,

Thank you for the patch.

On Friday 17 January 2014 14:52:47 Prabhakar Lad wrote:
> From: "Lad, Prabhakar" <prabhakar.csengg@gmail.com>
> 
> clk_set_rate(), clk_prepare_enable() functions can fail, so check the return
> values to avoid surprises.
> 
> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

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

I've applied the patch to my tree and will send a pull request.

> ---
>  drivers/media/i2c/mt9v032.c |   10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9v032.c b/drivers/media/i2c/mt9v032.c
> index 36c504b..40172b8 100644
> --- a/drivers/media/i2c/mt9v032.c
> +++ b/drivers/media/i2c/mt9v032.c
> @@ -317,8 +317,14 @@ static int mt9v032_power_on(struct mt9v032 *mt9v032)
>  	struct i2c_client *client = v4l2_get_subdevdata(&mt9v032->subdev);
>  	int ret;
> 
> -	clk_set_rate(mt9v032->clk, mt9v032->sysclk);
> -	clk_prepare_enable(mt9v032->clk);
> +	ret = clk_set_rate(mt9v032->clk, mt9v032->sysclk);
> +	if (ret < 0)
> +		return ret;
> +
> +	ret = clk_prepare_enable(mt9v032->clk);
> +	if (ret)
> +		return ret;
> +
>  	udelay(1);
> 
>  	/* Reset the chip and stop data read out */
-- 
Regards,

Laurent Pinchart


      reply	other threads:[~2014-01-19 20:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17  9:22 [PATCH] media: i2c: mt9v032: Check return value of clk_prepare_enable/clk_set_rate Prabhakar Lad
2014-01-19 20:05 ` 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=2157121.3izth3cqlo@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=prabhakar.csengg@gmail.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