diff options
Diffstat (limited to 'lib/random32.c')
-rw-r--r-- | lib/random32.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/random32.c b/lib/random32.c index 9085b1172015..339624191b51 100644 --- a/lib/random32.c +++ b/lib/random32.c @@ -38,6 +38,9 @@ #include <linux/jiffies.h> #include <linux/random.h> #include <linux/sched.h> +#include <linux/bitops.h> +#include <linux/slab.h> +#include <linux/notifier.h> #include <asm/unaligned.h> /** @@ -544,9 +547,11 @@ static void prandom_reseed(struct timer_list *unused) * To avoid worrying about whether it's safe to delay that interrupt * long enough to seed all CPUs, just schedule an immediate timer event. */ -static void prandom_timer_start(struct random_ready_callback *unused) +static int prandom_timer_start(struct notifier_block *nb, + unsigned long action, void *data) { mod_timer(&seed_timer, jiffies); + return 0; } /* @@ -555,13 +560,13 @@ static void prandom_timer_start(struct random_ready_callback *unused) */ static int __init prandom_init_late(void) { - static struct random_ready_callback random_ready = { - .func = prandom_timer_start + static struct notifier_block random_ready = { + .notifier_call = prandom_timer_start }; - int ret = add_random_ready_callback(&random_ready); + int ret = register_random_ready_notifier(&random_ready); if (ret == -EALREADY) { - prandom_timer_start(&random_ready); + prandom_timer_start(&random_ready, 0, NULL); ret = 0; } return ret; |