From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: Jingoo Han <jg1.han@samsung.com>,
"'Herbert Xu'" <herbert@gondor.apana.org.au>
Cc: <linux-kernel@vger.kernel.org>, "'Peter Korsgaard'" <jacmet@sunsite.dk>
Subject: Re: [PATCH 1/5] hwrng: atmel - Use devm_clk_get()
Date: Fri, 28 Feb 2014 14:52:31 +0100 [thread overview]
Message-ID: <5310949F.7000901@atmel.com> (raw)
In-Reply-To: <003e01cf3378$c9f54420$5ddfcc60$%han@samsung.com>
On 27/02/2014 06:00, Jingoo Han :
> Use devm_clk_get() to make cleanup paths simpler.
>
> Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks a lot.
> ---
> drivers/char/hw_random/atmel-rng.c | 8 ++------
> 1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/char/hw_random/atmel-rng.c b/drivers/char/hw_random/atmel-rng.c
> index dfeddf2..851bc7e 100644
> --- a/drivers/char/hw_random/atmel-rng.c
> +++ b/drivers/char/hw_random/atmel-rng.c
> @@ -63,13 +63,13 @@ static int atmel_trng_probe(struct platform_device *pdev)
> if (IS_ERR(trng->base))
> return PTR_ERR(trng->base);
>
> - trng->clk = clk_get(&pdev->dev, NULL);
> + trng->clk = devm_clk_get(&pdev->dev, NULL);
> if (IS_ERR(trng->clk))
> return PTR_ERR(trng->clk);
>
> ret = clk_enable(trng->clk);
> if (ret)
> - goto err_enable;
> + return ret;
>
> writel(TRNG_KEY | 1, trng->base + TRNG_CR);
> trng->rng.name = pdev->name;
> @@ -85,9 +85,6 @@ static int atmel_trng_probe(struct platform_device *pdev)
>
> err_register:
> clk_disable(trng->clk);
> -err_enable:
> - clk_put(trng->clk);
> -
> return ret;
> }
>
> @@ -99,7 +96,6 @@ static int atmel_trng_remove(struct platform_device *pdev)
>
> writel(TRNG_KEY, trng->base + TRNG_CR);
> clk_disable(trng->clk);
> - clk_put(trng->clk);
>
> return 0;
> }
>
--
Nicolas Ferre
next prev parent reply other threads:[~2014-02-28 13:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-27 5:00 [PATCH 1/5] hwrng: atmel - Use devm_clk_get() Jingoo Han
2014-02-27 5:02 ` [PATCH 2/5] hwrng: omap3-rom: " Jingoo Han
2014-02-27 5:04 ` [PATCH 3/5] hwrng: pixocell - " Jingoo Han
2014-02-27 5:06 ` [PATCH 4/5] hwrng: nomadik - Use devm_*() functions Jingoo Han
2014-03-05 2:02 ` Linus Walleij
2014-02-27 5:07 ` [PATCH 5/5] hwrng: timeriomem " Jingoo Han
2014-02-27 8:34 ` [PATCH 1/5] hwrng: atmel - Use devm_clk_get() Peter Korsgaard
2014-02-28 13:52 ` Nicolas Ferre [this message]
2014-03-10 12:21 ` Herbert Xu
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=5310949F.7000901@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=herbert@gondor.apana.org.au \
--cc=jacmet@sunsite.dk \
--cc=jg1.han@samsung.com \
--cc=linux-kernel@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.