From: Jingoo Han <jg1.han@samsung.com>
To: "'Herbert Xu'" <herbert@gondor.apana.org.au>
Cc: linux-kernel@vger.kernel.org,
"'Jamie Iles'" <jamie@jamieiles.com>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 3/5] hwrng: pixocell - Use devm_clk_get()
Date: Thu, 27 Feb 2014 14:04:28 +0900 [thread overview]
Message-ID: <004001cf3379$64363fd0$2ca2bf70$%han@samsung.com> (raw)
In-Reply-To: <003e01cf3378$c9f54420$5ddfcc60$%han@samsung.com>
Use devm_clk_get() to make cleanup paths simpler.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/char/hw_random/picoxcell-rng.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/char/hw_random/picoxcell-rng.c b/drivers/char/hw_random/picoxcell-rng.c
index c03beee..eab5448 100644
--- a/drivers/char/hw_random/picoxcell-rng.c
+++ b/drivers/char/hw_random/picoxcell-rng.c
@@ -108,7 +108,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
if (IS_ERR(rng_base))
return PTR_ERR(rng_base);
- rng_clk = clk_get(&pdev->dev, NULL);
+ rng_clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(rng_clk)) {
dev_warn(&pdev->dev, "no clk\n");
return PTR_ERR(rng_clk);
@@ -117,7 +117,7 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
ret = clk_enable(rng_clk);
if (ret) {
dev_warn(&pdev->dev, "unable to enable clk\n");
- goto err_enable;
+ return ret;
}
picoxcell_trng_start();
@@ -132,9 +132,6 @@ static int picoxcell_trng_probe(struct platform_device *pdev)
err_register:
clk_disable(rng_clk);
-err_enable:
- clk_put(rng_clk);
-
return ret;
}
@@ -142,7 +139,6 @@ static int picoxcell_trng_remove(struct platform_device *pdev)
{
hwrng_unregister(&picoxcell_trng);
clk_disable(rng_clk);
- clk_put(rng_clk);
return 0;
}
--
1.7.10.4
next prev parent reply other threads:[~2014-02-27 5:04 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 ` Jingoo Han [this message]
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
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='004001cf3379$64363fd0$2ca2bf70$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=herbert@gondor.apana.org.au \
--cc=jamie@jamieiles.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox