Skip to content

Commit

Permalink
bcma: move initializing of struct bcma_bus to own function.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hauke Mehrtens authored and John W. Linville committed Aug 8, 2011
1 parent 982eee6 commit 67a5c29
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/bcma/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit 67a5c29

Please sign in to comment.