aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-01-16 14:59:39 -0500
committerKalle Valo <kvalo@codeaurora.org>2015-01-23 12:44:58 -0500
commit799038ea9bbbfee240b85bcb17e487d44cdf5009 (patch)
tree8ab5ea60a4afa27cd952aa0afc58e2151f65e6bd /drivers/bcma/main.c
parent6b47aacaa4491ab04630ab0aec10d10e6ac9e14f (diff)
bcma: clean bus initialization code
This moves main bus init code to the main.c and renames old function to make its purpose clear. Thanks to this change we'll also be able to separate scanning from registration (and support PCIe Gen 2 devices) in the future. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/bcma/main.c')
-rw-r--r--drivers/bcma/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/bcma/main.c b/drivers/bcma/main.c
index 534e1337766d..c166d444fef6 100644
--- a/drivers/bcma/main.c
+++ b/drivers/bcma/main.c
@@ -268,6 +268,18 @@ void bcma_prepare_core(struct bcma_bus *bus, struct bcma_device *core)
268 } 268 }
269} 269}
270 270
271void bcma_init_bus(struct bcma_bus *bus)
272{
273 mutex_lock(&bcma_buses_mutex);
274 bus->num = bcma_bus_next_num++;
275 mutex_unlock(&bcma_buses_mutex);
276
277 INIT_LIST_HEAD(&bus->cores);
278 bus->nr_cores = 0;
279
280 bcma_detect_chip(bus);
281}
282
271static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core) 283static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
272{ 284{
273 int err; 285 int err;
@@ -369,10 +381,6 @@ int bcma_bus_register(struct bcma_bus *bus)
369 int err; 381 int err;
370 struct bcma_device *core; 382 struct bcma_device *core;
371 383
372 mutex_lock(&bcma_buses_mutex);
373 bus->num = bcma_bus_next_num++;
374 mutex_unlock(&bcma_buses_mutex);
375
376 /* Scan for devices (cores) */ 384 /* Scan for devices (cores) */
377 err = bcma_bus_scan(bus); 385 err = bcma_bus_scan(bus);
378 if (err) { 386 if (err) {