Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351924
b: refs/heads/master
c: 447d7e2
h: refs/heads/master
v: v3
  • Loading branch information
Nathan Hintz authored and John W. Linville committed Jan 14, 2013
1 parent 7414bfa commit 8e223db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a35ab937cb27ec8c00b6f13cade93dc10e22b670
refs/heads/master: 447d7e25be462329268f279bef2f6faa986a5185
22 changes: 11 additions & 11 deletions trunk/drivers/bcma/driver_pci_host.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
const void *buf, int len)
{
int err = -EINVAL;
u32 addr = 0, val = 0;
u32 addr, val;
void __iomem *mmio = 0;
u16 chipid = pc->core->bus->chipinfo.id;

Expand All @@ -165,12 +165,10 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,
* requires indirect access.
*/
if (off < PCI_CONFIG_SPACE_SIZE) {
addr = pc->core->addr + BCMA_CORE_PCI_PCICFG0;
addr = BCMA_CORE_PCI_PCICFG0;
addr |= (func << 8);
addr |= (off & 0xfc);
mmio = ioremap_nocache(addr, sizeof(val));
if (!mmio)
goto out;
val = pcicore_read32(pc, addr);
}
} else {
addr = bcma_get_cfgspace_addr(pc, dev, func, off);
Expand All @@ -189,26 +187,28 @@ static int bcma_extpci_write_config(struct bcma_drv_pci *pc, unsigned int dev,

switch (len) {
case 1:
val = readl(mmio);
val &= ~(0xFF << (8 * (off & 3)));
val |= *((const u8 *)buf) << (8 * (off & 3));
break;
case 2:
val = readl(mmio);
val &= ~(0xFFFF << (8 * (off & 3)));
val |= *((const u16 *)buf) << (8 * (off & 3));
break;
case 4:
val = *((const u32 *)buf);
break;
}
if (dev == 0 && !addr) {
if (dev == 0) {
/* accesses to config registers with offsets >= 256
* requires indirect access.
*/
addr = (func << 12);
addr |= (off & 0x0FFF);
bcma_pcie_write_config(pc, addr, val);
if (off >= PCI_CONFIG_SPACE_SIZE) {
addr = (func << 12);
addr |= (off & 0x0FFF);
bcma_pcie_write_config(pc, addr, val);
} else {
pcicore_write32(pc, addr, val);
}
} else {
writel(val, mmio);

Expand Down

0 comments on commit 8e223db

Please sign in to comment.