aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/bcma/driver_pci_host.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/bcma/driver_pci_host.c b/drivers/bcma/driver_pci_host.c
index c0cb0620ab62..f92124c29998 100644
--- a/drivers/bcma/driver_pci_host.c
+++ b/drivers/bcma/driver_pci_host.c
@@ -101,7 +101,7 @@ static int bcma_extpci_read_config(struct bcma_drv_pci *pc, unsigned int dev,
101 */ 101 */
102 if (off >= PCI_CONFIG_SPACE_SIZE) { 102 if (off >= PCI_CONFIG_SPACE_SIZE) {
103 addr = (func << 12); 103 addr = (func << 12);
104 addr |= (off & 0x0FFF); 104 addr |= (off & 0x0FFC);
105 val = bcma_pcie_read_config(pc, addr); 105 val = bcma_pcie_read_config(pc, addr);
106 } else { 106 } else {
107 addr = BCMA_CORE_PCI_PCICFG0; 107 addr = BCMA_CORE_PCI_PCICFG0;
@@ -164,7 +164,11 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
164 /* accesses to config registers with offsets >= 256 164 /* accesses to config registers with offsets >= 256
165 * requires indirect access. 165 * requires indirect access.
166 */ 166 */
167 if (off < PCI_CONFIG_SPACE_SIZE) { 167 if (off >= PCI_CONFIG_SPACE_SIZE) {
168 addr = (func << 12);
169 addr |= (off & 0x0FFC);
170 val = bcma_pcie_read_config(pc, addr);
171 } else {
168 addr = BCMA_CORE_PCI_PCICFG0; 172 addr = BCMA_CORE_PCI_PCICFG0;
169 addr |= (func << 8); 173 addr |= (func << 8);
170 addr |= (off & 0xfc); 174 addr |= (off & 0xfc);
@@ -202,13 +206,10 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
202 /* accesses to config registers with offsets >= 256 206 /* accesses to config registers with offsets >= 256
203 * requires indirect access. 207 * requires indirect access.
204 */ 208 */
205 if (off >= PCI_CONFIG_SPACE_SIZE) { 209 if (off >= PCI_CONFIG_SPACE_SIZE)
206 addr = (func << 12);
207 addr |= (off & 0x0FFF);
208 bcma_pcie_write_config(pc, addr, val); 210 bcma_pcie_write_config(pc, addr, val);
209 } else { 211 else
210 pcicore_write32(pc, addr, val); 212 pcicore_write32(pc, addr, val);
211 }
212 } else { 213 } else {
213 writel(val, mmio); 214 writel(val, mmio);
214 215