From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753960Ab0I2GaS (ORCPT ); Wed, 29 Sep 2010 02:30:18 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:53451 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753074Ab0I2GaO (ORCPT ); Wed, 29 Sep 2010 02:30:14 -0400 Date: Wed, 29 Sep 2010 15:30:11 +0900 From: Grant Likely To: Michal Simek Cc: linux-kernel@vger.kernel.org, john.williams@petalogix.com, edgar.iglesias@gmail.com, duyl@xilinx.com, linnj@xilinx.com, microblaze-uclinux@itee.uq.edu.au, Tejun Heo , Anton Vorontsov , devicetree-discuss@lists.ozlabs.org Subject: Re: [PATCH 1/7] of: GPIO: Fix OF probing on little-endian systems Message-ID: <20100929063011.GF2439@angua.secretlab.ca> References: <1285739538-29058-1-git-send-email-monstr@monstr.eu> <1285739538-29058-2-git-send-email-monstr@monstr.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1285739538-29058-2-git-send-email-monstr@monstr.eu> User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 29, 2010 at 03:52:12PM +1000, Michal Simek wrote: > DTB is always big-endian that's why is necessary > to convert it. > > Signed-off-by: Michal Simek > CC: Grant Likely > CC: Tejun Heo > CC: Anton Vorontsov > CC: linux-kernel@vger.kernel.org > CC: devicetree-discuss@lists.ozlabs.org Applied, thanks. g. > --- > 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 > From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Likely Subject: Re: [PATCH 1/7] of: GPIO: Fix OF probing on little-endian systems Date: Wed, 29 Sep 2010 15:30:11 +0900 Message-ID: <20100929063011.GF2439@angua.secretlab.ca> References: <1285739538-29058-1-git-send-email-monstr@monstr.eu> <1285739538-29058-2-git-send-email-monstr@monstr.eu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1285739538-29058-2-git-send-email-monstr-pSz03upnqPeHXe+LvDLADg@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Michal Simek Cc: microblaze-uclinux-rVRm/Wmeqae7NGdpmJTKYQ@public.gmane.org, devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tejun Heo , duyl-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org, linnj-gjFFaj9aHVfQT0dZR+AlfA@public.gmane.org, edgar.iglesias-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, Anton Vorontsov , john.williams-g5w7nrANp4BDPfheJLI6IQ@public.gmane.org List-Id: devicetree@vger.kernel.org On Wed, Sep 29, 2010 at 03:52:12PM +1000, Michal Simek wrote: > DTB is always big-endian that's why is necessary > to convert it. > > Signed-off-by: Michal Simek > CC: Grant Likely > CC: Tejun Heo > CC: Anton Vorontsov > CC: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org > CC: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Applied, thanks. g. > --- > 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 >