Search Linux Wireless

[PATCH] ssb: Use ioreadX() and iowriteX() for PCI.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <mb@xxxxxxxxx>

Index: wireless-dev/drivers/ssb/pci.c
===================================================================
--- wireless-dev.orig/drivers/ssb/pci.c	2007-09-19 17:15:58.000000000 +0200
+++ wireless-dev/drivers/ssb/pci.c	2007-09-19 17:31:44.000000000 +0200
@@ -531,7 +531,7 @@ static u16 ssb_pci_read16(struct ssb_dev
 		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)
@@ -544,7 +544,7 @@ static u32 ssb_pci_read32(struct ssb_dev
 		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)
@@ -557,7 +557,7 @@ static void ssb_pci_write16(struct ssb_d
 		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)
@@ -570,7 +570,7 @@ static void ssb_pci_write32(struct ssb_d
 		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 */
-
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux