diff options
-rw-r--r-- | drivers/of/fdt.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 4c5ee96bf487..543c5002831e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
19 | #include <linux/errno.h> | 19 | #include <linux/errno.h> |
20 | #include <linux/slab.h> | 20 | #include <linux/slab.h> |
21 | #include <linux/random.h> | ||
21 | 22 | ||
22 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ | 23 | #include <asm/setup.h> /* for COMMAND_LINE_SIZE */ |
23 | #ifdef CONFIG_PPC | 24 | #ifdef CONFIG_PPC |
@@ -726,3 +727,14 @@ void __init unflatten_device_tree(void) | |||
726 | } | 727 | } |
727 | 728 | ||
728 | #endif /* CONFIG_OF_EARLY_FLATTREE */ | 729 | #endif /* CONFIG_OF_EARLY_FLATTREE */ |
730 | |||
731 | /* Feed entire flattened device tree into the random pool */ | ||
732 | static int __init add_fdt_randomness(void) | ||
733 | { | ||
734 | if (initial_boot_params) | ||
735 | add_device_randomness(initial_boot_params, | ||
736 | be32_to_cpu(initial_boot_params->totalsize)); | ||
737 | |||
738 | return 0; | ||
739 | } | ||
740 | core_initcall(add_fdt_randomness); | ||