1 --- a/drivers/bcma/main.c
2 +++ b/drivers/bcma/main.c
3 @@ -637,11 +637,36 @@ static int bcma_device_uevent(struct dev
4 core->id.rev, core->id.class);
7 -static int __init bcma_modinit(void)
8 +static unsigned int bcma_bus_registered;
11 + * If built-in, bus has to be registered early, before any driver calls
12 + * bcma_driver_register.
13 + * Otherwise registering driver would trigger BUG in driver_register.
15 +static int __init bcma_init_bus_register(void)
19 + if (bcma_bus_registered)
22 err = bus_register(&bcma_bus_type);
24 + bcma_bus_registered = 1;
29 +fs_initcall(bcma_init_bus_register);
32 +/* Main initialization has to be done with SPI/mtd/NAND/SPROM available */
33 +static int __init bcma_modinit(void)
37 + err = bcma_init_bus_register();
41 @@ -660,7 +685,7 @@ static int __init bcma_modinit(void)
45 -fs_initcall(bcma_modinit);
46 +module_init(bcma_modinit);
48 static void __exit bcma_modexit(void)