spi/bcm63xx: fix standard accessors and compile guard
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>
This commit is contained in:
parent
158fcc4e05
commit
682b5280bf
@ -62,8 +62,8 @@ static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs,
|
|||||||
static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs,
|
static inline u16 bcm_spi_readw(struct bcm63xx_spi *bs,
|
||||||
unsigned int offset)
|
unsigned int offset)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_BIG_ENDIAN
|
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||||
return ioread16(bs->regs + bcm63xx_spireg(offset));
|
return ioread16be(bs->regs + bcm63xx_spireg(offset));
|
||||||
#else
|
#else
|
||||||
return readw(bs->regs + bcm63xx_spireg(offset));
|
return readw(bs->regs + bcm63xx_spireg(offset));
|
||||||
#endif
|
#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,
|
static inline void bcm_spi_writew(struct bcm63xx_spi *bs,
|
||||||
u16 value, unsigned int offset)
|
u16 value, unsigned int offset)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_BIG_ENDIAN
|
#ifdef CONFIG_CPU_BIG_ENDIAN
|
||||||
iowrite16(value, bs->regs + bcm63xx_spireg(offset));
|
iowrite16be(value, bs->regs + bcm63xx_spireg(offset));
|
||||||
#else
|
#else
|
||||||
writew(value, bs->regs + bcm63xx_spireg(offset));
|
writew(value, bs->regs + bcm63xx_spireg(offset));
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user