hwrng: pic32 - enable TRNG only while it's used
authorMartin Kaiser <martin@kaiser.cx>
Tue, 4 Jul 2023 17:32:03 +0000 (19:32 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Jul 2023 10:16:24 +0000 (22:16 +1200)
commitac0042fa5aa5ac7929d95f4bf9185429ccdb70cb
tree538386be1f5e5368bb90f5684d0b09d4e9047105
parent97c63a9dea2929fc4fd42f1d4446d97b6c011a1f
hwrng: pic32 - enable TRNG only while it's used

The probe function enables the TRNG hardware before registering the
driver. If registration fails, probe returns an error, but the TRNG
remains enabled.

Define init and cleanup functions, enable and disable the hardware there.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/pic32-rng.c