| 1 | From 30ef571a04dc19171c6b6664d88b60c39161eb42 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/26] bcma: move initializing of struct bcma_bus to own function. |
| 5 | MIME-Version: 1.0 |
| 6 | Content-Type: text/plain; charset=UTF-8 |
| 7 | Content-Transfer-Encoding: 8bit |
| 8 | |
| 9 | This makes it possible to use this code in some other method. |
| 10 | |
| 11 | Acked-by: Rafał Miłecki <zajec5@gmail.com> |
| 12 | Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> |
| 13 | --- |
| 14 | drivers/bcma/scan.c | 17 +++++++++++------ |
| 15 | 1 files changed, 11 insertions(+), 6 deletions(-) |
| 16 | |
| 17 | --- a/drivers/bcma/scan.c |
| 18 | +++ b/drivers/bcma/scan.c |
| 19 | @@ -312,15 +312,10 @@ static int bcma_get_next_core(struct bcm |
| 20 | return 0; |
| 21 | } |
| 22 | |
| 23 | -int bcma_bus_scan(struct bcma_bus *bus) |
| 24 | +static void bcma_init_bus(struct bcma_bus *bus) |
| 25 | { |
| 26 | - u32 erombase; |
| 27 | - u32 __iomem *eromptr, *eromend; |
| 28 | - |
| 29 | s32 tmp; |
| 30 | |
| 31 | - int err; |
| 32 | - |
| 33 | INIT_LIST_HEAD(&bus->cores); |
| 34 | bus->nr_cores = 0; |
| 35 | |
| 36 | @@ -330,6 +325,16 @@ int bcma_bus_scan(struct bcma_bus *bus) |
| 37 | bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT; |
| 38 | bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT; |
| 39 | bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT; |
| 40 | +} |
| 41 | + |
| 42 | +int bcma_bus_scan(struct bcma_bus *bus) |
| 43 | +{ |
| 44 | + u32 erombase; |
| 45 | + u32 __iomem *eromptr, *eromend; |
| 46 | + |
| 47 | + int err; |
| 48 | + |
| 49 | + bcma_init_bus(bus); |
| 50 | |
| 51 | erombase = bcma_scan_read32(bus, 0, BCMA_CC_EROM); |
| 52 | eromptr = bus->mmio; |
| 53 | |