Skip to content

Commit

Permalink
hwrng: omap - Change RNG_CONFIG_REG to RNG_CONTROL_REG in init
Browse files Browse the repository at this point in the history
omap4_rng_init() checks bit 10 of the RNG_CONFIG_REG to determine whether
the RNG is already running before performing any initiliasation. This is not
the correct register to check, as the enable bit is in RNG_CONFIG_CONTROL.
Read from RNG_CONTROL_REG instead.

Signed-off-by: Andre Wolokita <Andre.Wolokita@analog.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Andre Wolokita authored and Herbert Xu committed Mar 17, 2015
1 parent 1a5addf commit 656d7e7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/hw_random/omap-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int omap4_rng_init(struct omap_rng_dev *priv)
u32 val;

/* Return if RNG is already running. */
if (omap_rng_read(priv, RNG_CONFIG_REG) & RNG_CONTROL_ENABLE_TRNG_MASK)
if (omap_rng_read(priv, RNG_CONTROL_REG) & RNG_CONTROL_ENABLE_TRNG_MASK)
return 0;

val = RNG_CONFIG_MIN_REFIL_CYCLES << RNG_CONFIG_MIN_REFIL_CYCLES_SHIFT;
Expand Down

0 comments on commit 656d7e7

Please sign in to comment.