Skip to content

Commit

Permalink
bcma: use separated function to initialize bus on SoC
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Rafał Miłecki <[email protected]>
Acked-by: Hauke Mehrtens <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
  • Loading branch information
rmilecki authored and linvjw committed Sep 9, 2014
1 parent dc8ecdd commit a395135
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions arch/mips/bcm47xx/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,10 @@ static void __init bcm47xx_register_bcma(void)
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);

Expand Down
11 changes: 9 additions & 2 deletions drivers/bcma/host_soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ static const struct bcma_host_ops bcma_host_soc_ops = {
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.
Expand All @@ -181,7 +180,15 @@ int __init bcma_host_soc_register(struct bcma_soc *soc)
/* 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);
Expand Down
1 change: 1 addition & 0 deletions include/linux/bcma/bcma_soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ struct bcma_soc {
};

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);

Expand Down

0 comments on commit a395135

Please sign in to comment.