[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230710202733.116133-7-martin@kaiser.cx>
Date: Mon, 10 Jul 2023 22:27:32 +0200
From: Martin Kaiser <martin@...ser.cx>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: aric.pzqi@...enic.com, linux-crypto@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Martin Kaiser <martin@...ser.cx>
Subject: [PATCH 6/7] hwrng: ingenic - don't disable the rng in ingenic_trng_remove
There's no need to disable the rng in ingenic_trng_remove.
The driver's init function sets the CFG_GEN_EN bit to enable the
rng. The cleanup function clears CFG_GEN_EN to revert this.
The remove function calls hwrng_unregister. If the ingenic-trng is not
the current rng at this point, CFG_GEN_EN has already been cleared. If
the ingenic-trng is the current rng, drop_current_rng will call the
cleanup function.
Signed-off-by: Martin Kaiser <martin@...ser.cx>
---
drivers/char/hw_random/ingenic-trng.c | 5 -----
1 file changed, 5 deletions(-)
diff --git a/drivers/char/hw_random/ingenic-trng.c b/drivers/char/hw_random/ingenic-trng.c
index cc88a941c929..9c54721f8399 100644
--- a/drivers/char/hw_random/ingenic-trng.c
+++ b/drivers/char/hw_random/ingenic-trng.c
@@ -111,14 +111,9 @@ static int ingenic_trng_probe(struct platform_device *pdev)
static int ingenic_trng_remove(struct platform_device *pdev)
{
struct ingenic_trng *trng = platform_get_drvdata(pdev);
- unsigned int ctrl;
hwrng_unregister(&trng->rng);
- ctrl = readl(trng->base + TRNG_REG_CFG_OFFSET);
- ctrl &= ~CFG_GEN_EN;
- writel(ctrl, trng->base + TRNG_REG_CFG_OFFSET);
-
return 0;
}
--
2.30.2
Powered by blists - more mailing lists