[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220321200739.3572792-27-clabbe@baylibre.com>
Date: Mon, 21 Mar 2022 20:07:39 +0000
From: Corentin Labbe <clabbe@...libre.com>
To: heiko@...ech.de, herbert@...dor.apana.org.au, krzk+dt@...nel.org,
mturquette@...libre.com, robh+dt@...nel.org, sboyd@...nel.org
Cc: devicetree@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-clk@...r.kernel.org, linux-crypto@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org,
Corentin Labbe <clabbe@...libre.com>
Subject: [PATCH v3 26/26] crypto: rockchip: use read_poll_timeout
Use read_poll_timeout instead of open coding it.
Signed-off-by: Corentin Labbe <clabbe@...libre.com>
---
drivers/crypto/rockchip/rk3288_crypto_ahash.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/crypto/rockchip/rk3288_crypto_ahash.c b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
index 1d20f58275f0..0ea47f50607e 100644
--- a/drivers/crypto/rockchip/rk3288_crypto_ahash.c
+++ b/drivers/crypto/rockchip/rk3288_crypto_ahash.c
@@ -9,6 +9,7 @@
* Some ideas are from marvell/cesa.c and s5p-sss.c driver.
*/
#include <linux/device.h>
+#include <linux/iopoll.h>
#include <asm/unaligned.h>
#include "rk3288_crypto.h"
@@ -314,8 +315,7 @@ static int rk_hash_run(struct crypto_engine *engine, void *breq)
* efficiency, and make it response quickly when dma
* complete.
*/
- while (!readl(reg + RK_CRYPTO_HASH_STS))
- udelay(10);
+ read_poll_timeout(readl, v, v == 0, 10, 1000, false, reg + RK_CRYPTO_HASH_STS);
for (i = 0; i < crypto_ahash_digestsize(tfm) / 4; i++) {
v = readl(reg + RK_CRYPTO_HASH_DOUT_0 + i * 4);
--
2.34.1
Powered by blists - more mailing lists