linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonas Gorski <jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
To: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Florian Fainelli
	<florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
Subject: [PATCH V3 1/3] spi/bcm63xx: fix standard accessors and compile guard
Date: Mon, 12 Oct 2015 12:24:21 +0200	[thread overview]
Message-ID: <1444645463-20915-2-git-send-email-jogo@openwrt.org> (raw)
In-Reply-To: <1444645463-20915-1-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>

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-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
---
v2 -> v3:
 * Squash in revert of applied v1.
v1 -> v2:
 * Use the right guard and io*be.

 drivers/spi/spi-bcm63xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-bcm63xx.c b/drivers/spi/spi-bcm63xx.c
index ef05387..461891f 100644
--- a/drivers/spi/spi-bcm63xx.c
+++ b/drivers/spi/spi-bcm63xx.c
@@ -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
-- 
2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-10-12 10:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-12 10:24 [PATCH V3 0/3] spi/bcm63xx: cleanup and decouple from arch code Jonas Gorski
     [not found] ` <1444645463-20915-1-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2015-10-12 10:24   ` Jonas Gorski [this message]
     [not found]     ` <1444645463-20915-2-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2015-10-12 16:59       ` Applied "spi/bcm63xx: fix standard accessors and compile guard" to the spi tree Mark Brown
2015-10-12 10:24   ` [PATCH V3 2/3] spi/bcm63xx: move message control word description to register offsets Jonas Gorski
     [not found]     ` <1444645463-20915-3-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2015-10-12 16:59       ` Applied "spi/bcm63xx: move message control word description to register offsets" to the spi tree Mark Brown
2015-10-12 10:24   ` [PATCH V3 3/3] spi/bcm63xx: move register definitions into the driver Jonas Gorski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1444645463-20915-2-git-send-email-jogo@openwrt.org \
    --to=jogo-p3rkhjxn3npafugrpc6u6w@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).