spi/bcm63xx: replace custom io accessors with standard ones
authorJonas Gorski <jogo@openwrt.org>
Thu, 10 Sep 2015 14:11:42 +0000 (16:11 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 14 Sep 2015 18:48:16 +0000 (19:48 +0100)
Replace all bcm_read* with (io)read. Due to this block following
system endianness, make sure we match that.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm63xx.c

index c1364a8fa2689938d2cf3fdf149f005f6768f261..ef05387c13419dcdc51642e7460bb77b5bac78ba 100644 (file)
@@ -56,25 +56,33 @@ struct bcm63xx_spi {
 static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs,
                                unsigned int offset)
 {
-       return bcm_readb(bs->regs + bcm63xx_spireg(offset));
+       return readb(bs->regs + bcm63xx_spireg(offset));
 }
 
 static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs,
                                unsigned int offset)
 {
-       return bcm_readw(bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_BIG_ENDIAN
+       return ioread16(bs->regs + bcm63xx_spireg(offset));
+#else
+       return readw(bs->regs + bcm63xx_spireg(offset));
+#endif
 }
 
 static inline void bcm_spi_writeb(struct bcm63xx_spi *bs,
                                  u8 value, unsigned int offset)
 {
-       bcm_writeb(value, bs->regs + bcm63xx_spireg(offset));
+       writeb(value, bs->regs + bcm63xx_spireg(offset));
 }
 
 static inline void bcm_spi_writew(struct bcm63xx_spi *bs,
                                  u16 value, unsigned int offset)
 {
-       bcm_writew(value, bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_BIG_ENDIAN
+       iowrite16(value, bs->regs + bcm63xx_spireg(offset));
+#else
+       writew(value, bs->regs + bcm63xx_spireg(offset));
+#endif
 }
 
 static const unsigned bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = {