mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michal Simek <monstr@monstr.eu>
To: linux-kernel@vger.kernel.org
Cc: john.williams@petalogix.com, edgar.iglesias@gmail.com,
	duyl@xilinx.com, linnj@xilinx.com, grant.likely@secretlab.ca,
	microblaze-uclinux@itee.uq.edu.au,
	Michal Simek <monstr@monstr.eu>, Tejun Heo <tj@kernel.org>,
	Anton Vorontsov <avorontsov@ru.mvista.com>,
	devicetree-discuss@lists.ozlabs.org
Subject: [PATCH 1/7] of: GPIO: Fix OF probing on little-endian systems
Date: Wed, 29 Sep 2010 15:52:12 +1000	[thread overview]
Message-ID: <1285739538-29058-2-git-send-email-monstr@monstr.eu> (raw)
In-Reply-To: <1285739538-29058-1-git-send-email-monstr@monstr.eu>

DTB is always big-endian that's why is necessary
to convert it.

Signed-off-by: Michal Simek <monstr@monstr.eu>
CC: Grant Likely <grant.likely@secretlab.ca>
CC: Tejun Heo <tj@kernel.org>
CC: Anton Vorontsov <avorontsov@ru.mvista.com>
CC: linux-kernel@vger.kernel.org
CC: devicetree-discuss@lists.ozlabs.org
---
 drivers/gpio/xilinx_gpio.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/xilinx_gpio.c b/drivers/gpio/xilinx_gpio.c
index 7096909..846fbd5 100644
--- a/drivers/gpio/xilinx_gpio.c
+++ b/drivers/gpio/xilinx_gpio.c
@@ -171,13 +171,13 @@ static int __devinit xgpio_of_probe(struct device_node *np)
 	/* Update GPIO state shadow register with default value */
 	tree_info = of_get_property(np, "xlnx,dout-default", NULL);
 	if (tree_info)
-		chip->gpio_state = *tree_info;
+		chip->gpio_state = be32_to_cpup(tree_info);
 
 	/* Update GPIO direction shadow register with default value */
 	chip->gpio_dir = 0xFFFFFFFF; /* By default, all pins are inputs */
 	tree_info = of_get_property(np, "xlnx,tri-default", NULL);
 	if (tree_info)
-		chip->gpio_dir = *tree_info;
+		chip->gpio_dir = be32_to_cpup(tree_info);
 
 	/* Check device node and parent device node for device width */
 	chip->mmchip.gc.ngpio = 32; /* By default assume full GPIO controller */
@@ -186,7 +186,7 @@ static int __devinit xgpio_of_probe(struct device_node *np)
 		tree_info = of_get_property(np->parent,
 					    "xlnx,gpio-width", NULL);
 	if (tree_info)
-		chip->mmchip.gc.ngpio = *tree_info;
+		chip->mmchip.gc.ngpio = be32_to_cpup(tree_info);
 
 	spin_lock_init(&chip->gpio_lock);
 
-- 
1.5.5.1


  reply	other threads:[~2010-09-29  5:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-29  5:52 Microblaze little-endian port + driver changes Michal Simek
2010-09-29  5:52 ` Michal Simek [this message]
2010-09-29  5:52   ` [PATCH 2/7] of: MTD: Fix OF probing on little-endian systems Michal Simek
2010-09-29  5:52     ` [PATCH 3/7] of: Fix uart16550 initialization " Michal Simek
2010-09-29  5:52       ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms Michal Simek
2010-09-29  5:52         ` [PATCH 5/7] microblaze: Add PVR for endians plus detection Michal Simek
2010-09-29  5:52           ` [PATCH 6/7] microblaze: KGDB little endian support Michal Simek
2010-09-29  5:52             ` [PATCH 7/7] microblaze: Add support for little-endian Microblaze Michal Simek
2010-09-29  6:27               ` Grant Likely
     [not found]                 ` <AANLkTikvfr90AZRJXz6CQg2FJTG13ygzxp0J9OpkL03c@mail.gmail.com>
2010-09-29  7:48                   ` Grant Likely
2010-09-29  6:12           ` [PATCH 5/7] microblaze: Add PVR for endians plus detection Grant Likely
2010-09-29  6:11         ` [PATCH 4/7] net: emaclite: Add support for little-endian platforms Grant Likely
2010-09-29  6:27           ` David Miller
2010-09-29  7:33             ` Michal Simek
2010-09-29  6:29       ` [PATCH 3/7] of: Fix uart16550 initialization on little-endian systems Grant Likely
2010-09-29  6:29     ` [PATCH 2/7] of: MTD: Fix OF probing " Grant Likely
2010-09-29  6:30   ` [PATCH 1/7] of: GPIO: " Grant Likely
2010-10-10  6:02 ` Microblaze little-endian port + driver changes Grant Likely
2010-10-10 23:34   ` Michal Simek

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=1285739538-29058-2-git-send-email-monstr@monstr.eu \
    --to=monstr@monstr.eu \
    --cc=avorontsov@ru.mvista.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=duyl@xilinx.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=grant.likely@secretlab.ca \
    --cc=john.williams@petalogix.com \
    --cc=linnj@xilinx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=microblaze-uclinux@itee.uq.edu.au \
    --cc=tj@kernel.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

all inboxes | Powered by JetHome®