aboutsummaryrefslogtreecommitdiff
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2011-07-23 01:20:06 +0200
committerJohn W. Linville <linville@tuxdriver.com>2011-08-08 14:29:23 -0400
commit67a5c29e1623edda5ff3f0355af533e72a245ad9 (patch)
tree1ef3954a0c8f0d2d7b4a6d8167e121da5bfdda0f /drivers/bcma
parent982eee67dd703a37edc3532b85e3a4122b5eb90b (diff)
bcma: move initializing of struct bcma_bus to own function.
This makes it possible to use this code in some other method. Acked-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma')
-rw-r--r--drivers/bcma/scan.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index 4012d8d93e9..79705534217 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -312,15 +312,10 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
return 0;
}
-int bcma_bus_scan(struct bcma_bus *bus)
+static void bcma_init_bus(struct bcma_bus *bus)
{
- u32 erombase;
- u32 __iomem *eromptr, *eromend;
-
s32 tmp;
- int err;
-
INIT_LIST_HEAD(&bus->cores);
bus->nr_cores = 0;
@@ -330,6 +325,16 @@ int bcma_bus_scan(struct bcma_bus *bus)
bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
+}
+
+int bcma_bus_scan(struct bcma_bus *bus)
+{
+ u32 erombase;
+ u32 __iomem *eromptr, *eromend;
+
+ int err;
+
+ bcma_init_bus(bus);
erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM);
eromptr = bus->mmio;