From: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
To: Josh Wu <josh.wu@atmel.com>
Cc: linux-media@vger.kernel.org, nicolas.ferre@atmel.com,
linux@arm.linux.org.uk, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 2/2] [media] V4L: atmel-isi: add clk_prepare()/clk_unprepare() functions
Date: Tue, 6 Dec 2011 10:49:12 +0100 (CET) [thread overview]
Message-ID: <Pine.LNX.4.64.1112061045150.10715@axis700.grange> (raw)
In-Reply-To: <1322647604-30662-2-git-send-email-josh.wu@atmel.com>
Hi Josh
Thanks for the patch, but I'll ask you to fix the same thing in it, that
I've fixed for you in the first patch in this series:
On Wed, 30 Nov 2011, Josh Wu wrote:
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> ---
> drivers/media/video/atmel-isi.c | 17 ++++++++++++++++-
> 1 files changed, 16 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/video/atmel-isi.c b/drivers/media/video/atmel-isi.c
> index ea4eef4..5da4381 100644
> --- a/drivers/media/video/atmel-isi.c
> +++ b/drivers/media/video/atmel-isi.c
[snip]
> @@ -978,10 +986,14 @@ static int __devinit atmel_isi_probe(struct platform_device *pdev)
> goto err_clk_get;
> }
>
> + ret = clk_prepare(isi->mck);
> + if (ret)
> + goto err_set_mck_rate;
> +
> /* Set ISI_MCK's frequency, it should be faster than pixel clock */
> ret = clk_set_rate(isi->mck, pdata->mck_hz);
> if (ret < 0)
> - goto err_set_mck_rate;
> + goto err_unprepare_mck;
>
> isi->p_fb_descriptors = dma_alloc_coherent(&pdev->dev,
> sizeof(struct fbd) * MAX_BUFFER_NUM,
> @@ -1058,11 +1070,14 @@ err_alloc_ctx:
> isi->p_fb_descriptors,
> isi->fb_descriptors_phys);
> err_alloc_descriptors:
> +err_unprepare_mck:
> + clk_unprepare(isi->mck);
> err_set_mck_rate:
> clk_put(isi->mck);
> err_clk_get:
> kfree(isi);
> err_alloc_isi:
> + clk_unprepare(pclk);
> clk_put(pclk);
>
> return ret;
Please, use error label names consistently. As you can see, currently the
driver uses the convention
ret = do_something();
if (ret < 0)
goto err_do_something;
i.e., the label is called after the operation, that has failed, not after
the clean up step, that the control now has to jump to. Please, update
your patch to also use this convention.
Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
next prev parent reply other threads:[~2011-12-06 9:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-30 10:06 [PATCH 1/2] [media] V4L: atmel-isi: add code to enable/disable ISI_MCK clock Josh Wu
2011-11-30 10:06 ` [PATCH 2/2] [media] V4L: atmel-isi: add clk_prepare()/clk_unprepare() functions Josh Wu
2011-12-06 9:49 ` Guennadi Liakhovetski [this message]
2011-12-07 6:09 ` Wu, Josh
2011-12-07 8:49 ` [PATCH 1/2] [media] V4L: atmel-isi: add code to enable/disable ISI_MCK clock Russell King - ARM Linux
2011-12-07 10:12 ` [PATCH 1/2] [media] V4L: atmel-isi: add code to enable/disableISI_MCK clock Wu, Josh
2011-12-07 22:39 ` Russell King - ARM Linux
2011-12-08 3:18 ` [PATCH 1/2] [media] V4L: atmel-isi: add code toenable/disableISI_MCK clock Wu, Josh
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=Pine.LNX.4.64.1112061045150.10715@axis700.grange \
--to=g.liakhovetski@gmx.de \
--cc=josh.wu@atmel.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=nicolas.ferre@atmel.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
all inboxes | Powered by JetHome®