[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210727102339.49141-4-tony@atomide.com>
Date: Tue, 27 Jul 2021 13:23:37 +0300
From: Tony Lindgren <tony@...mide.com>
To: "David S . Miller" <davem@...emloft.net>,
Herbert Xu <herbert@...dor.apana.org.au>,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org
Cc: linux-crypto@...r.kernel.org, Lokesh Vutla <lokeshvutla@...com>,
Tero Kristo <kristo@...nel.org>
Subject: [PATCH 4/6] crypto: omap-sham - drop old hw_init and unused FLAGS_INIT
FLAGS_INIT is now unused and we can just use standard runtime PM
functions instead.
Cc: Lokesh Vutla <lokeshvutla@...com>
Cc: Tero Kristo <kristo@...nel.org>
Signed-off-by: Tony Lindgren <tony@...mide.com>
---
drivers/crypto/omap-sham.c | 26 +++++---------------------
1 file changed, 5 insertions(+), 21 deletions(-)
diff --git a/drivers/crypto/omap-sham.c b/drivers/crypto/omap-sham.c
--- a/drivers/crypto/omap-sham.c
+++ b/drivers/crypto/omap-sham.c
@@ -105,7 +105,6 @@
#define FLAGS_FINAL 1
#define FLAGS_DMA_ACTIVE 2
#define FLAGS_OUTPUT_READY 3
-#define FLAGS_INIT 4
#define FLAGS_CPU 5
#define FLAGS_DMA_READY 6
#define FLAGS_AUTO_XOR 7
@@ -368,24 +367,6 @@ static void omap_sham_copy_ready_hash(struct ahash_request *req)
hash[i] = le32_to_cpup((__le32 *)in + i);
}
-static int omap_sham_hw_init(struct omap_sham_dev *dd)
-{
- int err;
-
- err = pm_runtime_resume_and_get(dd->dev);
- if (err < 0) {
- dev_err(dd->dev, "failed to get sync: %d\n", err);
- return err;
- }
-
- if (!test_bit(FLAGS_INIT, &dd->flags)) {
- set_bit(FLAGS_INIT, &dd->flags);
- dd->err = 0;
- }
-
- return 0;
-}
-
static void omap_sham_write_ctrl_omap2(struct omap_sham_dev *dd, size_t length,
int final, int dma)
{
@@ -1093,10 +1074,13 @@ static int omap_sham_hash_one_req(struct crypto_engine *engine, void *areq)
dev_dbg(dd->dev, "hash-one: op: %u, total: %u, digcnt: %zd, final: %d",
ctx->op, ctx->total, ctx->digcnt, final);
- err = omap_sham_hw_init(dd);
- if (err)
+ err = pm_runtime_resume_and_get(dd->dev);
+ if (err < 0) {
+ dev_err(dd->dev, "failed to get sync: %d\n", err);
return err;
+ }
+ dd->err = 0;
dd->req = req;
if (ctx->digcnt)
--
2.32.0
Powered by blists - more mailing lists