From: Tony Lindgren <tony@atomide.com>
To: "David S . Miller" <davem@davemloft.net>,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org
Cc: linux-crypto@vger.kernel.org, Lokesh Vutla <lokeshvutla@ti.com>,
Tero Kristo <kristo@kernel.org>
Subject: [PATCH 4/6] crypto: omap-sham - drop old hw_init and unused FLAGS_INIT
Date: Tue, 27 Jul 2021 13:23:37 +0300 [thread overview]
Message-ID: <20210727102339.49141-4-tony@atomide.com> (raw)
In-Reply-To: <20210727102339.49141-1-tony@atomide.com>
FLAGS_INIT is now unused and we can just use standard runtime PM
functions instead.
Cc: Lokesh Vutla <lokeshvutla@ti.com>
Cc: Tero Kristo <kristo@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.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
next prev parent reply other threads:[~2021-07-27 10:25 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 10:23 [PATCH 1/6] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() Tony Lindgren
2021-07-27 10:23 ` [PATCH 2/6] crypto: omap-sham - initialize req only after omap_sham_hw_init() Tony Lindgren
2021-07-27 10:23 ` [PATCH 3/6] crypto: omap-sham - add missing pm_runtime_dontuse_autosuspend() Tony Lindgren
2021-07-27 10:23 ` Tony Lindgren [this message]
2021-07-27 10:23 ` [PATCH 5/6] crypto: omap-sham - drop suspend and resume functions Tony Lindgren
2021-07-27 10:23 ` [PATCH 6/6] crypto: omap-sham - drop pm_runtime_irqsafe() usage Tony Lindgren
2021-08-06 12:14 ` [PATCH 1/6] crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop() 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=20210727102339.49141-4-tony@atomide.com \
--to=tony@atomide.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kristo@kernel.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=lokeshvutla@ti.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®