diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2011-07-22 19:20:06 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2011-08-08 14:29:23 -0400 |
commit | 67a5c29e1623edda5ff3f0355af533e72a245ad9 (patch) | |
tree | 1ef3954a0c8f0d2d7b4a6d8167e121da5bfdda0f | |
parent | 982eee67dd703a37edc3532b85e3a4122b5eb90b (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>
-rw-r--r-- | drivers/bcma/scan.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c index 4012d8d93e91..79705534217e 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, | |||
312 | return 0; | 312 | return 0; |
313 | } | 313 | } |
314 | 314 | ||
315 | int bcma_bus_scan(struct bcma_bus *bus) | 315 | static void bcma_init_bus(struct bcma_bus *bus) |
316 | { | 316 | { |
317 | u32 erombase; | ||
318 | u32 __iomem *eromptr, *eromend; | ||
319 | |||
320 | s32 tmp; | 317 | s32 tmp; |
321 | 318 | ||
322 | int err; | ||
323 | |||
324 | INIT_LIST_HEAD(&bus->cores); | 319 | INIT_LIST_HEAD(&bus->cores); |
325 | bus->nr_cores = 0; | 320 | bus->nr_cores = 0; |
326 | 321 | ||
@@ -330,6 +325,16 @@ int bcma_bus_scan(struct bcma_bus *bus) | |||
330 | bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; | 325 | bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; |
331 | bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; | 326 | bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; |
332 | bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; | 327 | bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; |
328 | } | ||
329 | |||
330 | int bcma_bus_scan(struct bcma_bus *bus) | ||
331 | { | ||
332 | u32 erombase; | ||
333 | u32 __iomem *eromptr, *eromend; | ||
334 | |||
335 | int err; | ||
336 | |||
337 | bcma_init_bus(bus); | ||
333 | 338 | ||
334 | erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); | 339 | erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); |
335 | eromptr = bus->mmio; | 340 | eromptr = bus->mmio; |