This is required to split SoC bus init into two phases. The later one
(which includes scanning) should be called when kalloc is available.
Cc: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
                pr_warn("bcm47xx: someone else already registered a bcma SPROM callback handler (err %d)\n", err);
 
        err = bcma_host_soc_register(&bcm47xx_bus.bcma);
+       if (err)
+               panic("Failed to register BCMA bus (err %d)", err);
+
+       err = bcma_host_soc_init(&bcm47xx_bus.bcma);
        if (err)
                panic("Failed to initialize BCMA bus (err %d)", err);
 
 
 int __init bcma_host_soc_register(struct bcma_soc *soc)
 {
        struct bcma_bus *bus = &soc->bus;
-       int err;
 
        /* iomap only first core. We have to read some register on this core
         * to scan the bus.
        /* Initialize struct, detect chip */
        bcma_init_bus(bus);
 
-       /* Register */
+       return 0;
+}
+
+int __init bcma_host_soc_init(struct bcma_soc *soc)
+{
+       struct bcma_bus *bus = &soc->bus;
+       int err;
+
+       /* Scan bus and initialize it */
        err = bcma_bus_early_register(bus, &soc->core_cc, &soc->core_mips);
        if (err)
                iounmap(bus->mmio);
 
 };
 
 int __init bcma_host_soc_register(struct bcma_soc *soc);
+int __init bcma_host_soc_init(struct bcma_soc *soc);
 
 int bcma_bus_register(struct bcma_bus *bus);