| 1 | From dd6cbe9b9e2ae563659b34184f4cd9d905dc90d5 Mon Sep 17 00:00:00 2001 |
| 2 | From: Hauke Mehrtens <hauke@hauke-m.de> |
| 3 | Date: Sat, 18 Jun 2011 11:55:47 +0200 |
| 4 | Subject: [PATCH 02/14] bcma: move initializing of struct bcma_bus to own function. |
| 5 | |
| 6 | This makes it possible to use this code in some other method. |
| 7 | |
| 8 | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> |
| 9 | --- |
| 10 | drivers/bcma/scan.c | 17 +++++++++++------ |
| 11 | 1 files changed, 11 insertions(+), 6 deletions(-) |
| 12 | |
| 13 | --- a/drivers/bcma/scan.c |
| 14 | +++ b/drivers/bcma/scan.c |
| 15 | @@ -312,15 +312,10 @@ static int bcma_get_next_core(struct bcm |
| 16 | return 0; |
| 17 | } |
| 18 | |
| 19 | -int bcma_bus_scan(struct bcma_bus *bus) |
| 20 | +static void bcma_init_bus(struct bcma_bus *bus) |
| 21 | { |
| 22 | - u32 erombase; |
| 23 | - u32 __iomem *eromptr, *eromend; |
| 24 | - |
| 25 | s32 tmp; |
| 26 | |
| 27 | - int err; |
| 28 | - |
| 29 | INIT_LIST_HEAD(&bus->cores); |
| 30 | bus->nr_cores = 0; |
| 31 | |
| 32 | @@ -330,6 +325,16 @@ int bcma_bus_scan(struct bcma_bus *bus) |
| 33 | bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; |
| 34 | bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; |
| 35 | bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; |
| 36 | +} |
| 37 | + |
| 38 | +int bcma_bus_scan(struct bcma_bus *bus) |
| 39 | +{ |
| 40 | + u32 erombase; |
| 41 | + u32 __iomem *eromptr, *eromend; |
| 42 | + |
| 43 | + int err; |
| 44 | + |
| 45 | + bcma_init_bus(bus); |
| 46 | |
| 47 | erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); |
| 48 | eromptr = bus->mmio; |
| 49 | |