summaryrefslogtreecommitdiffstats
path: root/drivers/bcma/main.c
diff options
context:
space:
mode:
authorRafał Miłecki2015-01-16 20:59:39 +0100
committerKalle Valo2015-01-23 18:44:58 +0100
commit799038ea9bbbfee240b85bcb17e487d44cdf5009 (patch)
tree8ab5ea60a4afa27cd952aa0afc58e2151f65e6bd /drivers/bcma/main.c
parentb43: stop leds during suspend (diff)
downloadkernel-qcow2-linux-799038ea9bbbfee240b85bcb17e487d44cdf5009.tar.gz
kernel-qcow2-linux-799038ea9bbbfee240b85bcb17e487d44cdf5009.tar.xz
kernel-qcow2-linux-799038ea9bbbfee240b85bcb17e487d44cdf5009.zip
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)
}
}
+void bcma_init_bus(struct bcma_bus *bus)
+{
+ mutex_lock(&bcma_buses_mutex);
+ bus->num = bcma_bus_next_num++;
+ mutex_unlock(&bcma_buses_mutex);
+
+ INIT_LIST_HEAD(&bus->cores);
+ bus->nr_cores = 0;
+
+ bcma_detect_chip(bus);
+}
+
static void bcma_register_core(struct bcma_bus *bus, struct bcma_device *core)
{
int err;
@@ -369,10 +381,6 @@ int bcma_bus_register(struct bcma_bus *bus)
int err;
struct bcma_device *core;
- mutex_lock(&bcma_buses_mutex);
- bus->num = bcma_bus_next_num++;
- mutex_unlock(&bcma_buses_mutex);
-
/* Scan for devices (cores) */
err = bcma_bus_scan(bus);
if (err) {