lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Sep 2010 15:30:11 +0900
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Michal Simek <monstr@...str.eu>
Cc:	linux-kernel@...r.kernel.org, john.williams@...alogix.com,
	edgar.iglesias@...il.com, duyl@...inx.com, linnj@...inx.com,
	microblaze-uclinux@...e.uq.edu.au, Tejun Heo <tj@...nel.org>,
	Anton Vorontsov <avorontsov@...mvista.com>,
	devicetree-discuss@...ts.ozlabs.org
Subject: Re: [PATCH 1/7] of: GPIO: Fix OF probing on little-endian systems

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 <monstr@...str.eu>
> CC: Grant Likely <grant.likely@...retlab.ca>
> CC: Tejun Heo <tj@...nel.org>
> CC: Anton Vorontsov <avorontsov@...mvista.com>
> CC: linux-kernel@...r.kernel.org
> CC: devicetree-discuss@...ts.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
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ