Skip to content

Commit

Permalink
[SSB]: Use ioreadX() and iowriteX() for PCI.
Browse files Browse the repository at this point in the history
On a PCI bus use ioreadX() and iowriteX().
We map the I/O space with pci_iomap(), so we must use the correct
accessor functions, too.
readX() and writeX() are not guaranteed to accept the cookie returned
from pci_iomap() (though, it currently works on most architectures).

Signed-off-by: Michael Buesch <[email protected]>
Signed-off-by: John W. Linville <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Michael Buesch authored and David S. Miller committed Oct 10, 2007
1 parent b85b3b7 commit 4b402c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ssb/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ static u16 ssb_pci_read16(struct ssb_device *dev, u16 offset)
if (unlikely(ssb_pci_switch_core(bus, dev)))
return 0xFFFF;
}
return readw(bus->mmio + offset);
return ioread16(bus->mmio + offset);
}

static u32 ssb_pci_read32(struct ssb_device *dev, u16 offset)
Expand All @@ -544,7 +544,7 @@ static u32 ssb_pci_read32(struct ssb_device *dev, u16 offset)
if (unlikely(ssb_pci_switch_core(bus, dev)))
return 0xFFFFFFFF;
}
return readl(bus->mmio + offset);
return ioread32(bus->mmio + offset);
}

static void ssb_pci_write16(struct ssb_device *dev, u16 offset, u16 value)
Expand All @@ -557,7 +557,7 @@ static void ssb_pci_write16(struct ssb_device *dev, u16 offset, u16 value)
if (unlikely(ssb_pci_switch_core(bus, dev)))
return;
}
writew(value, bus->mmio + offset);
iowrite16(value, bus->mmio + offset);
}

static void ssb_pci_write32(struct ssb_device *dev, u16 offset, u32 value)
Expand All @@ -570,7 +570,7 @@ static void ssb_pci_write32(struct ssb_device *dev, u16 offset, u32 value)
if (unlikely(ssb_pci_switch_core(bus, dev)))
return;
}
writel(value, bus->mmio + offset);
iowrite32(value, bus->mmio + offset);
}

/* Not "static", as it's used in main.c */
Expand Down

0 comments on commit 4b402c6

Please sign in to comment.