diff mbox series

[1/6] hw_random: explicit ordering of initcalls

Message ID 20220124202951.28579-1-linux@dominikbrodowski.net
State Accepted
Commit 26a03981318d2e0f12456a1041fe3bf8af5416cf
Headers show
Series [1/6] hw_random: explicit ordering of initcalls | expand

Commit Message

Dominik Brodowski Jan. 24, 2022, 8:29 p.m. UTC
hw-random device drivers depend on the hw-random core being
initialized. Make this ordering explicit, also for the case
these drivers are built-in. As the core itself depends on
misc_register() which is set up at subsys_initcall time,
advance the initialization of the core (only) to the
fs_initcall() level.

Cc: Matt Mackall <mpm@selenic.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
---
 drivers/char/hw_random/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Herbert Xu Feb. 5, 2022, 4:30 a.m. UTC | #1
On Mon, Jan 24, 2022 at 09:29:46PM +0100, Dominik Brodowski wrote:
> hw-random device drivers depend on the hw-random core being
> initialized. Make this ordering explicit, also for the case
> these drivers are built-in. As the core itself depends on
> misc_register() which is set up at subsys_initcall time,
> advance the initialization of the core (only) to the
> fs_initcall() level.
> 
> Cc: Matt Mackall <mpm@selenic.com>
> Cc: Herbert Xu <herbert@gondor.apana.org.au>
> Cc: Jason A. Donenfeld <Jason@zx2c4.com>
> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
> ---
>  drivers/char/hw_random/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

All applied.  Thanks.
diff mbox series

Patch

diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c
index a3db27916256..e860e044b19e 100644
--- a/drivers/char/hw_random/core.c
+++ b/drivers/char/hw_random/core.c
@@ -638,7 +638,7 @@  static void __exit hwrng_modexit(void)
 	unregister_miscdev();
 }
 
-module_init(hwrng_modinit);
+fs_initcall(hwrng_modinit); /* depends on misc_register() */
 module_exit(hwrng_modexit);
 
 MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver");