bcma: populate bus DT subnodes as platform_device-s
[firefly-linux-kernel-4.4.55.git] / drivers / bcma / main.c
index 9635f1033ce5c46e7aba2863fa04a8bc86421aa9..59128478a90fd3200c131be97225b8d97eb8763d 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include <linux/of_address.h>
 #include <linux/of_irq.h>
+#include <linux/of_platform.h>
 
 MODULE_DESCRIPTION("Broadcom's specific AMBA driver");
 MODULE_LICENSE("GPL");
@@ -409,6 +410,13 @@ int bcma_bus_register(struct bcma_bus *bus)
                bcma_core_pci_early_init(&bus->drv_pci[0]);
        }
 
+       if (bus->host_pdev) {
+               struct device *dev = &bus->host_pdev->dev;
+
+               of_platform_populate(dev->of_node, of_default_bus_match_table,
+                                    NULL, dev);
+       }
+
        /* Cores providing flash access go before SPROM init */
        list_for_each_entry(core, &bus->cores, list) {
                if (bcma_is_core_needed_early(core->id.id))