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]
Message-ID: <CAOjnSCZgx5H75t8QrXj1WQ_SaU_4HDYeK+_XdBRmwUXzHW=iJw@mail.gmail.com>
Date:	Mon, 9 Feb 2015 09:41:17 -0500
From:	Tyler Hall <tylerwhall@...il.com>
To:	"Holmberg, Hans" <hans.holmberg@...el.com>
Cc:	Alexandre Courbot <gnurou@...il.com>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	Daniel Mack <zonque@...il.com>,
	Linus Walleij <linus.walleij@...aro.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Howard Cochran <cochran@...mark.com>,
	Robert Jarzmik <robert.jarzmik@...e.fr>
Subject: Re: gpio-pxa: getting GPIOs by devicetree phandle broken

> The issue with multiple gpiochips per of-node could be worked around as followed I believe, comments?
>
> diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
> index 08261f2..43984ab 100644
> --- a/drivers/gpio/gpiolib-of.c
> +++ b/drivers/gpio/gpiolib-of.c
> @@ -47,11 +47,12 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data)
>         ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags);
>         if (ret < 0) {
>                 /* We've found the gpio chip, but the translation failed.
> -                * Return true to stop looking and return the translation
> -                * error via out_gpio
> +                * Store translation error in out_gpio.
> +                * Return false to keep looking, as more than one GPIO chip
> +                * could be registered per of-node.
>                  */
>                 gg_data->out_gpio = ERR_PTR(ret);
> -               return true;
> +               return false;
>          }
>
>         gg_data->out_gpio = gpiochip_get_desc(gc, ret);

As long as we're ok with multiple gpiochips per of-node, this would
work for me. It'll change the preference of which chip returns the
error in the case of multiple chips, but that's already undefined
behavior.
--
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