diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2014-08-22 02:44:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-28 14:41:56 -0400 |
commit | ecf47e9bb796558423fa87b43a8fe55f086ca56e (patch) | |
tree | c73bdc4cc0126d0d47faf4bfff8841f24e2a36be /drivers/bcma | |
parent | 89be7ceb80835238f04c09cb6efc2c70aabd02e8 (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')
-rw-r--r-- | drivers/bcma/host_soc.c | 4 | ||||
-rw-r--r-- | drivers/bcma/scan.c | 11 |
2 files changed, 11 insertions, 4 deletions
diff --git a/drivers/bcma/host_soc.c b/drivers/bcma/host_soc.c index 3475e600011a..1edd7e064621 100644 --- a/drivers/bcma/host_soc.c +++ b/drivers/bcma/host_soc.c | |||
@@ -134,12 +134,16 @@ static void bcma_host_soc_block_write(struct bcma_device *core, | |||
134 | 134 | ||
135 | static u32 bcma_host_soc_aread32(struct bcma_device *core, u16 offset) | 135 | static u32 bcma_host_soc_aread32(struct bcma_device *core, u16 offset) |
136 | { | 136 | { |
137 | if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n")) | ||
138 | return ~0; | ||
137 | return readl(core->io_wrap + offset); | 139 | return readl(core->io_wrap + offset); |
138 | } | 140 | } |
139 | 141 | ||
140 | static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset, | 142 | static void bcma_host_soc_awrite32(struct bcma_device *core, u16 offset, |
141 | u32 value) | 143 | u32 value) |
142 | { | 144 | { |
145 | if (WARN_ONCE(!core->io_wrap, "Accessed core has no wrapper/agent\n")) | ||
146 | return; | ||
143 | writel(value, core->io_wrap + offset); | 147 | writel(value, core->io_wrap + offset); |
144 | } | 148 | } |
145 | 149 | ||
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, | |||
421 | core->io_addr = ioremap_nocache(core->addr, BCMA_CORE_SIZE); | 421 | core->io_addr = ioremap_nocache(core->addr, BCMA_CORE_SIZE); |
422 | if (!core->io_addr) | 422 | if (!core->io_addr) |
423 | return -ENOMEM; | 423 | return -ENOMEM; |
424 | core->io_wrap = ioremap_nocache(core->wrap, BCMA_CORE_SIZE); | 424 | if (core->wrap) { |
425 | if (!core->io_wrap) { | 425 | core->io_wrap = ioremap_nocache(core->wrap, |
426 | iounmap(core->io_addr); | 426 | BCMA_CORE_SIZE); |
427 | return -ENOMEM; | 427 | if (!core->io_wrap) { |
428 | iounmap(core->io_addr); | ||
429 | return -ENOMEM; | ||
430 | } | ||
428 | } | 431 | } |
429 | } | 432 | } |
430 | return 0; | 433 | return 0; |