aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bcma
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2012-09-29 14:33:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-10-19 15:52:38 -0400
commit3c25ddd9655eb35f439d9cf92cea0077ce1d4f2c (patch)
tree1dc9ef53c6ae770a23954286da737cbff50eb817 /drivers/bcma
parente661b75a44cc811426ea005c3cb858e45bd73d57 (diff)
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')
-rw-r--r--drivers/bcma/driver_mips.c23
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);
181static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore) 181static void bcma_core_mips_flash_detect(struct bcma_drv_mips *mcore)
182{ 182{
183 struct bcma_bus *bus = mcore->core->bus; 183 struct bcma_bus *bus = mcore->core->bus;
184 struct bcma_drv_cc *cc = &bus->drv_cc;
184 185
185 switch (bus->drv_cc.capabilities & BCMA_CC_CAP_FLASHT) { 186 switch (cc->capabilities & BCMA_CC_CAP_FLASHT) {
186 case BCMA_CC_FLASHT_STSER: 187 case BCMA_CC_FLASHT_STSER:
187 case BCMA_CC_FLASHT_ATSER: 188 case BCMA_CC_FLASHT_ATSER:
188 bcma_debug(bus, "Found serial flash\n"); 189 bcma_debug(bus, "Found serial flash\n");
189 bcma_sflash_init(&bus->drv_cc); 190 bcma_sflash_init(cc);
190 break; 191 break;
191 case BCMA_CC_FLASHT_PARA: 192 case BCMA_CC_FLASHT_PARA:
192 bcma_debug(bus, "Found parallel flash\n"); 193 bcma_debug(bus, "Found parallel flash\n");
193 bus->drv_cc.pflash.present = true; 194 cc->pflash.present = true;
194 bus->drv_cc.pflash.window = BCMA_SOC_FLASH2; 195 cc->pflash.window = BCMA_SOC_FLASH2;
195 bus->drv_cc.pflash.window_size = BCMA_SOC_FLASH2_SZ; 196 cc->pflash.window_size = BCMA_SOC_FLASH2_SZ;
196 197
197 if ((bcma_read32(bus->drv_cc.core, BCMA_CC_FLASH_CFG) & 198 if ((bcma_read32(cc->core, BCMA_CC_FLASH_CFG) &
198 BCMA_CC_FLASH_CFG_DS) == 0) 199 BCMA_CC_FLASH_CFG_DS) == 0)
199 bus->drv_cc.pflash.buswidth = 1; 200 cc->pflash.buswidth = 1;
200 else 201 else
201 bus->drv_cc.pflash.buswidth = 2; 202 cc->pflash.buswidth = 2;
202 break; 203 break;
203 default: 204 default:
204 bcma_err(bus, "Flash type not supported\n"); 205 bcma_err(bus, "Flash type not supported\n");
205 } 206 }
206 207
207 if (bus->drv_cc.core->id.rev == 38 || 208 if (cc->core->id.rev == 38 ||
208 bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) { 209 bus->chipinfo.id == BCMA_CHIP_ID_BCM4706) {
209 if (bus->drv_cc.capabilities & BCMA_CC_CAP_NFLASH) { 210 if (cc->capabilities & BCMA_CC_CAP_NFLASH) {
210 bcma_debug(bus, "Found NAND flash\n"); 211 bcma_debug(bus, "Found NAND flash\n");
211 bcma_nflash_init(&bus->drv_cc); 212 bcma_nflash_init(cc);
212 } 213 }
213 } 214 }
214} 215}