hwrng: remember rng chosen by user
authorHarald Freudenberger <freude@linux.vnet.ibm.com>
Tue, 11 Jul 2017 07:36:23 +0000 (09:36 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 18 Jul 2017 10:16:09 +0000 (18:16 +0800)
commit10a515ddb5f19a1ff0b9882c430b4427843169f3
treedd27f8af0c53de1189c738574ff4d702e27e142b
parent2bbb6983887fefc8026beab01198d30f47b7bd22
hwrng: remember rng chosen by user

When a user chooses a rng source via sysfs attribute
this rng should be sticky, even when other sources
with better quality to register. This patch introduces
a simple way to remember the user's choice. This is
reflected by a new sysfs attribute file 'rng_selected'
which shows if the current rng has been chosen by
userspace. The new attribute file shows '1' for user
selected rng and '0' otherwise.

Signed-off-by: Harald Freudenberger <freude@linux.vnet.ibm.com>
Reviewed-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/char/hw_random/core.c