#include <linux/percpu.h>
 #include <linux/cryptohash.h>
 #include <linux/fips.h>
+#include <linux/freezer.h>
 #include <linux/ptrace.h>
 #include <linux/workqueue.h>
 #include <linux/irq.h>
                                size_t entropy)
 {
        struct entropy_store *poolp = &input_pool;
-       bool frozen = false;
 
        if (unlikely(crng_init == 0)) {
                crng_fast_load(buffer, count);
         * We'll be woken up again once below random_write_wakeup_thresh,
         * or when the calling thread is about to terminate.
         */
-       wait_event_interruptible(random_write_wait,
-                       kthread_freezable_should_stop(&frozen) ||
+       wait_event_freezable(random_write_wait,
+                       kthread_should_stop() ||
                        ENTROPY_BITS(&input_pool) <= random_write_wakeup_bits);
-       if (!frozen) {
-               mix_pool_bytes(poolp, buffer, count);
-               credit_entropy_bits(poolp, entropy);
-       }
+       mix_pool_bytes(poolp, buffer, count);
+       credit_entropy_bits(poolp, entropy);
 }
 EXPORT_SYMBOL_GPL(add_hwgenerator_randomness);