lkml.org 
[lkml]   [2023]   [Aug]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/3] hwrng: imx-rngc - read status register for error checks
Date
The error bit in the status register of the imx-rngc is set for any kind
of error. Details about the error can be read from the bits in the error
status register.

In the imx_rngc_self_test, we just need the info if there was an error or
not. We can check the status register, there's no need to read the error
status register.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
---
drivers/char/hw_random/imx-rngc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/char/hw_random/imx-rngc.c b/drivers/char/hw_random/imx-rngc.c
index 85207535fd12..d2df468fd460 100644
--- a/drivers/char/hw_random/imx-rngc.c
+++ b/drivers/char/hw_random/imx-rngc.c
@@ -114,7 +114,7 @@ static int imx_rngc_self_test(struct imx_rngc *rngc)
if (ret < 0)
return ret;

- return readl(rngc->base + RNGC_ERROR) ? -EIO : 0;
+ return (status & RNGC_STATUS_ERROR) ? -EIO : 0;
}

static int imx_rngc_read(struct hwrng *rng, void *data, size_t max, bool wait)
--
2.39.2
\
 
 \ /
  Last update: 2023-08-22 17:29    [W:1.994 / U:0.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site