spi/bcm63xx: fix standard accessors and compile guard
authorJonas Gorski <jogo@openwrt.org>
Mon, 12 Oct 2015 10:24:21 +0000 (12:24 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 12 Oct 2015 16:24:32 +0000 (17:24 +0100)
Use the correct guard CONFIG_CPU_BIG_ENDIAN and the *be accessors to
follow native endianness on big endian systems.

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

index ef05387c13419dcdc51642e7460bb77b5bac78ba..461891fbc198fb12bd88f7b62e515e52ef3e01db 100644 (file)
@@ -62,8 +62,8 @@ static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs,
 static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs,
                                unsigned int offset)
 {
-#ifdef CONFIG_BIG_ENDIAN
-       return ioread16(bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       return ioread16be(bs->regs + bcm63xx_spireg(offset));
 #else
        return readw(bs->regs + bcm63xx_spireg(offset));
 #endif
@@ -78,8 +78,8 @@ static inline void bcm_spi_writeb(struct bcm63xx_spi *bs,
 static inline void bcm_spi_writew(struct bcm63xx_spi *bs,
                                  u16 value, unsigned int offset)
 {
-#ifdef CONFIG_BIG_ENDIAN
-       iowrite16(value, bs->regs + bcm63xx_spireg(offset));
+#ifdef CONFIG_CPU_BIG_ENDIAN
+       iowrite16be(value, bs->regs + bcm63xx_spireg(offset));
 #else
        writew(value, bs->regs + bcm63xx_spireg(offset));
 #endif