From: Geoff Levand Date: Fri, 30 Jun 2023 21:58:46 +0000 (+0000) Subject: ntb_netdev: Fix module_init problem X-Git-Tag: v6.6.7~2382^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce946519f95fe8f74ee1dba25512a33895520f41;p=platform%2Fkernel%2Flinux-starfive.git ntb_netdev: Fix module_init problem With both the ntb_transport_init and the ntb_netdev_init_module routines in the module_init init group, the ntb_netdev_init_module routine can be called before the ntb_transport_init routine that it depends on is called. To assure the proper initialization order put ntb_netdev_init_module in the late_initcall group. Fixes runtime errors where the ntb_netdev_init_module call fails with ENODEV. Signed-off-by: Geoff Levand Reviewed-by: Dave Jiang Signed-off-by: Jon Mason --- diff --git a/drivers/net/ntb_netdev.c b/drivers/net/ntb_netdev.c index 85dbe7f..536bd65 100644 --- a/drivers/net/ntb_netdev.c +++ b/drivers/net/ntb_netdev.c @@ -493,7 +493,7 @@ static int __init ntb_netdev_init_module(void) return 0; } -module_init(ntb_netdev_init_module); +late_initcall(ntb_netdev_init_module); static void __exit ntb_netdev_exit_module(void) {