Rather than having callers of set_current_rng call drop_current_rng,
we can do it directly in set_current_rng.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
MODULE_PARM_DESC(default_quality,
"default entropy content of hwrng per mill");
+static void drop_current_rng(void);
static void start_khwrngd(void);
static inline int rng_get_data(struct hwrng *rng, u8 *buffer, size_t size,
static void set_current_rng(struct hwrng *rng)
{
BUG_ON(!mutex_is_locked(&rng_mutex));
+ drop_current_rng();
current_rng = rng;
}
err = hwrng_init(rng);
if (err)
break;
- drop_current_rng();
set_current_rng(rng);
err = 0;
break;