diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-09-29 20:33:52 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-10-19 15:52:38 -0400 |
commit | 3c25ddd9655eb35f439d9cf92cea0077ce1d4f2c (patch) | |
tree | 1dc9ef53c6ae770a23954286da737cbff50eb817 /drivers/bcma/driver_mips.c | |
parent | e661b75a44cc811426ea005c3cb858e45bd73d57 (diff) | |
download | linux-stable-3c25ddd9655eb35f439d9cf92cea0077ce1d4f2c.tar.gz linux-stable-3c25ddd9655eb35f439d9cf92cea0077ce1d4f2c.tar.bz2 linux-stable-3c25ddd9655eb35f439d9cf92cea0077ce1d4f2c.zip |
bcma: extract drv_cc in bcma_core_mips_flash_detect()
This makes the code more readable
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/driver_mips.c')
-rw-r--r-- | drivers/bcma/driver_mips.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/bcma/driver_mips.c b/drivers/bcma/driver_mips.c index d8e2fba482e6..170822ea51c7 100644 --- a/drivers/bcma/driver_mips.c +++ b/drivers/bcma/driver_mips.c @@ -181,34 +181,35 @@ EXPORT_SYMBOL(bcma_cpu_clock); static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) { struct bcma_bus *bus = mcore->core->bus; + struct bcma_drv_cc *cc = &bus->drv_cc; - switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) { + switch (cc->capabilities & BCMA_CC_CAP_FLASHT) { case BCMA_CC_FLASHT_STSER: case BCMA_CC_FLASHT_ATSER: bcma_debug(bus, "Found serial flash\n"); - bcma_sflash_init(&bus->drv_cc); + bcma_sflash_init(cc); break; case BCMA_CC_FLASHT_PARA: bcma_debug(bus, "Found parallel flash\n"); - bus->drv_cc.pflash.present = true; - bus->drv_cc.pflash.window = BCMA_SOC_FLASH2; - bus->drv_cc.pflash.window_size = BCMA_SOC_FLASH2_SZ; + cc->pflash.present = true; + cc->pflash.window = BCMA_SOC_FLASH2; + cc->pflash.window_size = BCMA_SOC_FLASH2_SZ; - if ((bcma_read32(bus->drv_cc.core, BCMA_CC_FLASH_CFG) & + if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) & BCMA_CC_FLASH_CFG_DS) == 0) - bus->drv_cc.pflash.buswidth = 1; + cc->pflash.buswidth = 1; else - bus->drv_cc.pflash.buswidth = 2; + cc->pflash.buswidth = 2; break; default: bcma_err(bus, "Flash type not supported\n"); } - if (bus->drv_cc.core->id.rev == 38 || + if (cc->core->id.rev == 38 || bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { - if (bus->drv_cc.capabilities & BCMA_CC_CAP_NFLASH) { + if (cc->capabilities & BCMA_CC_CAP_NFLASH) { bcma_debug(bus, "Found NAND flash\n"); - bcma_nflash_init(&bus->drv_cc); + bcma_nflash_init(cc); } } } |