Skip to content

Commit f23f218

Browse files
tmlindherbertx
authored andcommitted
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 <[email protected]> Cc: Tero Kristo <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent f83fc1a commit f23f218

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

drivers/crypto/omap-sham.c

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@
105105
#define FLAGS_FINAL 1
106106
#define FLAGS_DMA_ACTIVE 2
107107
#define FLAGS_OUTPUT_READY 3
108-
#define FLAGS_INIT 4
109108
#define FLAGS_CPU 5
110109
#define FLAGS_DMA_READY 6
111110
#define FLAGS_AUTO_XOR 7
@@ -368,24 +367,6 @@ static void omap_sham_copy_ready_hash(struct ahash_request *req)
368367
hash[i] = le32_to_cpup((__le32 *)in + i);
369368
}
370369

371-
static int omap_sham_hw_init(struct omap_sham_dev *dd)
372-
{
373-
int err;
374-
375-
err = pm_runtime_resume_and_get(dd->dev);
376-
if (err < 0) {
377-
dev_err(dd->dev, "failed to get sync: %d\n", err);
378-
return err;
379-
}
380-
381-
if (!test_bit(FLAGS_INIT, &dd->flags)) {
382-
set_bit(FLAGS_INIT, &dd->flags);
383-
dd->err = 0;
384-
}
385-
386-
return 0;
387-
}
388-
389370
static void omap_sham_write_ctrl_omap2(struct omap_sham_dev *dd, size_t length,
390371
int final, int dma)
391372
{
@@ -1093,10 +1074,13 @@ static int omap_sham_hash_one_req(struct crypto_engine *engine, void *areq)
10931074
dev_dbg(dd->dev, "hash-one: op: %u, total: %u, digcnt: %zd, final: %d",
10941075
ctx->op, ctx->total, ctx->digcnt, final);
10951076

1096-
err = omap_sham_hw_init(dd);
1097-
if (err)
1077+
err = pm_runtime_resume_and_get(dd->dev);
1078+
if (err < 0) {
1079+
dev_err(dd->dev, "failed to get sync: %d\n", err);
10981080
return err;
1081+
}
10991082

1083+
dd->err = 0;
11001084
dd->req = req;
11011085

11021086
if (ctx->digcnt)

0 commit comments

Comments
 (0)