bcma: use standard bus scanning during early register
Starting with kernel 3.19-rc1 early registration of bcma on MIPS is done a bit later, with memory allocator available. This allows us to simplify code by using standard bus scanning method. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
committed by
Kalle Valo
parent
908414af25
commit
c5ed1df781
@@ -489,35 +489,20 @@ void bcma_bus_unregister(struct bcma_bus *bus)
|
||||
kfree(cores[0]);
|
||||
}
|
||||
|
||||
int __init bcma_bus_early_register(struct bcma_bus *bus,
|
||||
struct bcma_device *core_cc,
|
||||
struct bcma_device *core_mips)
|
||||
/*
|
||||
* This is a special version of bus registration function designed for SoCs.
|
||||
* It scans bus and performs basic initialization of main cores only.
|
||||
* Please note it requires memory allocation, however it won't try to sleep.
|
||||
*/
|
||||
int __init bcma_bus_early_register(struct bcma_bus *bus)
|
||||
{
|
||||
int err;
|
||||
struct bcma_device *core;
|
||||
struct bcma_device_id match;
|
||||
|
||||
match.manuf = BCMA_MANUF_BCM;
|
||||
match.id = bcma_cc_core_id(bus);
|
||||
match.class = BCMA_CL_SIM;
|
||||
match.rev = BCMA_ANY_REV;
|
||||
|
||||
/* Scan for chip common core */
|
||||
err = bcma_bus_scan_early(bus, &match, core_cc);
|
||||
/* Scan for devices (cores) */
|
||||
err = bcma_bus_scan(bus);
|
||||
if (err) {
|
||||
bcma_err(bus, "Failed to scan for common core: %d\n", err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
match.manuf = BCMA_MANUF_MIPS;
|
||||
match.id = BCMA_CORE_MIPS_74K;
|
||||
match.class = BCMA_CL_SIM;
|
||||
match.rev = BCMA_ANY_REV;
|
||||
|
||||
/* Scan for mips core */
|
||||
err = bcma_bus_scan_early(bus, &match, core_mips);
|
||||
if (err) {
|
||||
bcma_err(bus, "Failed to scan for mips core: %d\n", err);
|
||||
bcma_err(bus, "Failed to scan bus: %d\n", err);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user