All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: crypto: picoxcell: Update to the current clk API
@ 2015-06-19 13:55 ` Michael van der Westhuizen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael van der Westhuizen @ 2015-06-19 13:55 UTC (permalink / raw)
  To: linux-crypto
  Cc: Jamie Iles, Herbert Xu, David Miller, linux-arm-kernel,
	Michael van der Westhuizen

The picoXcell hardware crypto accelerator driver was using an
older version of the clk framework, and not (un)preparing the
clock before enabling/disabling it.  This change uses the handy
clk_prepare_enable function to interact with the current clk
framework correctly.

Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
---
 drivers/crypto/picoxcell_crypto.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c
index 5da5b98..c5a9e5d 100644
--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1754,15 +1754,15 @@ static int spacc_probe(struct platform_device *pdev)
 		return PTR_ERR(engine->clk);
 	}
 
-	if (clk_enable(engine->clk)) {
-		dev_info(&pdev->dev, "unable to enable clk\n");
+	if (clk_prepare_enable(engine->clk)) {
+		dev_info(&pdev->dev, "unable to prepare/enable clk\n");
 		clk_put(engine->clk);
 		return -EIO;
 	}
 
 	err = device_create_file(&pdev->dev, &dev_attr_stat_irq_thresh);
 	if (err) {
-		clk_disable(engine->clk);
+		clk_disable_unprepare(engine->clk);
 		clk_put(engine->clk);
 		return err;
 	}
@@ -1830,7 +1830,7 @@ static int spacc_remove(struct platform_device *pdev)
 		crypto_unregister_alg(&alg->alg);
 	}
 
-	clk_disable(engine->clk);
+	clk_disable_unprepare(engine->clk);
 	clk_put(engine->clk);
 
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] arm: crypto: picoxcell: Update to the current clk API
@ 2015-06-19 13:55 ` Michael van der Westhuizen
  0 siblings, 0 replies; 4+ messages in thread
From: Michael van der Westhuizen @ 2015-06-19 13:55 UTC (permalink / raw)
  To: linux-arm-kernel

The picoXcell hardware crypto accelerator driver was using an
older version of the clk framework, and not (un)preparing the
clock before enabling/disabling it.  This change uses the handy
clk_prepare_enable function to interact with the current clk
framework correctly.

Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
---
 drivers/crypto/picoxcell_crypto.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/crypto/picoxcell_crypto.c b/drivers/crypto/picoxcell_crypto.c
index 5da5b98..c5a9e5d 100644
--- a/drivers/crypto/picoxcell_crypto.c
+++ b/drivers/crypto/picoxcell_crypto.c
@@ -1754,15 +1754,15 @@ static int spacc_probe(struct platform_device *pdev)
 		return PTR_ERR(engine->clk);
 	}
 
-	if (clk_enable(engine->clk)) {
-		dev_info(&pdev->dev, "unable to enable clk\n");
+	if (clk_prepare_enable(engine->clk)) {
+		dev_info(&pdev->dev, "unable to prepare/enable clk\n");
 		clk_put(engine->clk);
 		return -EIO;
 	}
 
 	err = device_create_file(&pdev->dev, &dev_attr_stat_irq_thresh);
 	if (err) {
-		clk_disable(engine->clk);
+		clk_disable_unprepare(engine->clk);
 		clk_put(engine->clk);
 		return err;
 	}
@@ -1830,7 +1830,7 @@ static int spacc_remove(struct platform_device *pdev)
 		crypto_unregister_alg(&alg->alg);
 	}
 
-	clk_disable(engine->clk);
+	clk_disable_unprepare(engine->clk);
 	clk_put(engine->clk);
 
 	return 0;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: crypto: picoxcell: Update to the current clk API
  2015-06-19 13:55 ` Michael van der Westhuizen
@ 2015-06-21 12:06   ` Herbert Xu
  -1 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2015-06-21 12:06 UTC (permalink / raw)
  To: Michael van der Westhuizen
  Cc: linux-crypto, Jamie Iles, David Miller, linux-arm-kernel

On Fri, Jun 19, 2015 at 03:55:51PM +0200, Michael van der Westhuizen wrote:
> The picoXcell hardware crypto accelerator driver was using an
> older version of the clk framework, and not (un)preparing the
> clock before enabling/disabling it.  This change uses the handy
> clk_prepare_enable function to interact with the current clk
> framework correctly.
> 
> Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: crypto: picoxcell: Update to the current clk API
@ 2015-06-21 12:06   ` Herbert Xu
  0 siblings, 0 replies; 4+ messages in thread
From: Herbert Xu @ 2015-06-21 12:06 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jun 19, 2015 at 03:55:51PM +0200, Michael van der Westhuizen wrote:
> The picoXcell hardware crypto accelerator driver was using an
> older version of the clk framework, and not (un)preparing the
> clock before enabling/disabling it.  This change uses the handy
> clk_prepare_enable function to interact with the current clk
> framework correctly.
> 
> Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>

Applied.
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-06-21 12:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-19 13:55 [PATCH] arm: crypto: picoxcell: Update to the current clk API Michael van der Westhuizen
2015-06-19 13:55 ` Michael van der Westhuizen
2015-06-21 12:06 ` Herbert Xu
2015-06-21 12:06   ` Herbert Xu

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.