Skip to content

Commit 30cfb02

Browse files
haukelinvjw
authored andcommitted
bcma: init sprom struct earlier
The PCIe host driver and the chip common initialisation accesses the sprom struct, but it is not initialized when these functions are run. Move the sprom parsing up in to do it earlier. As we need the chip common core rev and some other attributes from the chip common core, the early initialization is done before accessing the sprom. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1 parent 49655bb commit 30cfb02

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

‎drivers/bcma/main.c‎

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,20 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
182182
return -1;
183183
}
184184

185+
/* Early init CC core */
186+
core = bcma_find_core(bus, bcma_cc_core_id(bus));
187+
if (core) {
188+
bus->drv_cc.core = core;
189+
bcma_core_chipcommon_early_init(&bus->drv_cc);
190+
}
191+
192+
/* Try to get SPROM */
193+
err = bcma_sprom_get(bus);
194+
if (err == -ENOENT) {
195+
bcma_err(bus, "No SPROM available\n");
196+
} else if (err)
197+
bcma_err(bus, "Failed to get SPROM: %d\n", err);
198+
185199
/* Init CC core */
186200
core = bcma_find_core(bus, bcma_cc_core_id(bus));
187201
if (core) {
@@ -210,13 +224,6 @@ int __devinit bcma_bus_register(struct bcma_bus *bus)
210224
bcma_core_gmac_cmn_init(&bus->drv_gmac_cmn);
211225
}
212226

213-
/* Try to get SPROM */
214-
err = bcma_sprom_get(bus);
215-
if (err == -ENOENT) {
216-
bcma_err(bus, "No SPROM available\n");
217-
} else if (err)
218-
bcma_err(bus, "Failed to get SPROM: %d\n", err);
219-
220227
/* Register found cores */
221228
bcma_register_cores(bus);
222229

0 commit comments

Comments
 (0)