Commit fe91ab5e authored by David S. Miller's avatar David S. Miller

Fix generic device layer init sequence.

Generic BUS objects have to be registered before
devices assosciated with them are probed.  Therefore
subsys_initcall is inappropriate for such setups.
It does not work to use core_initcall for this because
the generic device layer bits need to be setup first too.
So we rename unused_initcall to postcore_initcall and use
this new initcall level for generic BUS object init.
This fixes bootup on Alpha, and Sparc64.  X86 was working
by what looks to be luck in link order.
parent 20906bc5
......@@ -44,6 +44,6 @@ static int sys_bus_init(void)
return device_register(&system_bus);
}
subsys_initcall(sys_bus_init);
postcore_initcall(sys_bus_init);
EXPORT_SYMBOL(register_sys_device);
EXPORT_SYMBOL(unregister_sys_device);
......@@ -204,7 +204,7 @@ static int __init pci_driver_init(void)
return bus_register(&pci_bus_type);
}
subsys_initcall(pci_driver_init);
postcore_initcall(pci_driver_init);
EXPORT_SYMBOL(pci_match_device);
EXPORT_SYMBOL(pci_register_driver);
......
......@@ -61,7 +61,7 @@ extern initcall_t __initcall_start, __initcall_end;
static initcall_t __initcall_##fn __attribute__ ((unused,__section__ (".initcall" level ".init"))) = fn
#define core_initcall(fn) __define_initcall("1",fn)
#define unused_initcall(fn) __define_initcall("2",fn)
#define postcore_initcall(fn) __define_initcall("2",fn)
#define arch_initcall(fn) __define_initcall("3",fn)
#define subsys_initcall(fn) __define_initcall("4",fn)
#define fs_initcall(fn) __define_initcall("5",fn)
......@@ -160,7 +160,7 @@ typedef void (*__cleanup_module_func_t)(void);
#define __setup(str,func) /* nothing */
#define core_initcall(fn) module_init(fn)
#define unused_initcall(fn) module_init(fn)
#define postcore_initcall(fn) module_init(fn)
#define arch_initcall(fn) module_init(fn)
#define subsys_initcall(fn) module_init(fn)
#define fs_initcall(fn) module_init(fn)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment