summaryrefslogtreecommitdiff
path: root/drivers/bcma/scan.c
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2014-08-22 08:44:52 +0200
committerJohn W. Linville <linville@tuxdriver.com>2014-08-28 14:41:56 -0400
commitecf47e9bb796558423fa87b43a8fe55f086ca56e (patch)
treec73bdc4cc0126d0d47faf4bfff8841f24e2a36be /drivers/bcma/scan.c
parent89be7ceb80835238f04c09cb6efc2c70aabd02e8 (diff)
bcma: only map wrapper if its address is available
The Chipcommon B core does not have a wrap address and it would fail here. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/bcma/scan.c')
-rw-r--r--drivers/bcma/scan.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
index b4764c6bcf17..e9bd77249a4c 100644
--- a/drivers/bcma/scan.c
+++ b/drivers/bcma/scan.c
@@ -421,10 +421,13 @@ static int bcma_get_next_core(struct bcma_bus *bus, u32 __iomem **eromptr,
core->io_addr = ioremap_nocache(core->addr, BCMA_CORE_SIZE);
if (!core->io_addr)
return -ENOMEM;
- core->io_wrap = ioremap_nocache(core->wrap, BCMA_CORE_SIZE);
- if (!core->io_wrap) {
- iounmap(core->io_addr);
- return -ENOMEM;
+ if (core->wrap) {
+ core->io_wrap = ioremap_nocache(core->wrap,
+ BCMA_CORE_SIZE);
+ if (!core->io_wrap) {
+ iounmap(core->io_addr);
+ return -ENOMEM;
+ }
}
}
return 0;