[PATCH 1/7] atmel_nand: check gpio validity before using it
Sascha Hauer
s.hauer at pengutronix.de
Mon Dec 9 03:36:57 EST 2013
The series looks fine for me. Jean-Christophe?
Sascha
On Sat, Dec 07, 2013 at 10:36:54AM +0100, Eric Bénard wrote:
> else we get : "invalid GPIO -22"
> (as enable_pin is EINVAL)
>
> tested on SAMA5D35
>
> Signed-off-by: Eric Bénard <eric at eukrea.com>
> ---
> drivers/mtd/nand/atmel_nand.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index a0f0966..658ae52 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -107,7 +107,7 @@ static struct nand_ecclayout atmel_pmecc_oobinfo;
> */
> static void atmel_nand_enable(struct atmel_nand_host *host)
> {
> - if (host->board->enable_pin)
> + if (gpio_is_valid(host->board->enable_pin))
> gpio_set_value(host->board->enable_pin, 0);
> }
>
> @@ -116,7 +116,7 @@ static void atmel_nand_enable(struct atmel_nand_host *host)
> */
> static void atmel_nand_disable(struct atmel_nand_host *host)
> {
> - if (host->board->enable_pin)
> + if (gpio_is_valid(host->board->enable_pin))
> gpio_set_value(host->board->enable_pin, 1);
> }
>
> --
> 1.8.3.1
>
>
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
More information about the barebox
mailing list