Commit cbd07781 authored by Martin Kaiser's avatar Martin Kaiser Committed by Herbert Xu

hwrng: imx-rngc - use bitfield macros to read rng type

Use the mechanism from bitfield.h to read the rng type field in the
version_id register. This makes the code a tiny bit simpler.
Signed-off-by: default avatarMartin Kaiser <martin@kaiser.cx>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 97ecafc4
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#define RNGC_FIFO 0x0014 #define RNGC_FIFO 0x0014
/* the fields in the ver id register */ /* the fields in the ver id register */
#define RNGC_TYPE_SHIFT 28 #define RNG_TYPE GENMASK(31, 28)
#define RNGC_VER_MAJ_SHIFT 8 #define RNGC_VER_MAJ_SHIFT 8
/* the rng_type field */ /* the rng_type field */
...@@ -251,7 +251,7 @@ static int imx_rngc_probe(struct platform_device *pdev) ...@@ -251,7 +251,7 @@ static int imx_rngc_probe(struct platform_device *pdev)
return irq; return irq;
ver_id = readl(rngc->base + RNGC_VER_ID); ver_id = readl(rngc->base + RNGC_VER_ID);
rng_type = ver_id >> RNGC_TYPE_SHIFT; rng_type = FIELD_GET(RNG_TYPE, ver_id);
/* /*
* This driver supports only RNGC and RNGB. (There's a different * This driver supports only RNGC and RNGB. (There's a different
* driver for RNGA.) * driver for RNGA.)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment