Skip to content

Commit

Permalink
bcma: populate bus DT subnodes as platform_device-s
Browse files Browse the repository at this point in the history
Our bus should allow defining children nodes as we may want to specify
devices attached to the bus. This is required e.g. to specify NAND or
ChipCommon cores and use bus's address and IRQ mappings.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
  • Loading branch information
Rafał Miłecki authored and Kalle Valo committed Jul 21, 2015
1 parent ae86c58 commit cae761b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/bcma/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit cae761b

Please sign in to comment.