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: <CAAVeFuJRrQ2_5mU-eRu=iuBygv7WQtnRov9zUWXPaBV=7Wdpdg@mail.gmail.com>
Date:	Wed, 29 Jun 2016 14:08:50 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	Venkat Reddy Talla <vreddytalla@...dia.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Laxman Dewangan <ldewangan@...dia.com>
Subject: Re: [PATCH 1/1] gpio: max77620: get gpio value based on direction

On Mon, Jun 27, 2016 at 7:56 PM, Venkat Reddy Talla
<vreddytalla@...dia.com> wrote:
> Gpio direction is determined by DIRx bit of GPIO
> configuration register, return max77620 gpio value
> based on direction in or out.
>
> Signed-off-by: Venkat Reddy Talla <vreddytalla@...dia.com>
> ---
>  drivers/gpio/gpio-max77620.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-max77620.c b/drivers/gpio/gpio-max77620.c
> index 8658c32..b46b436 100644
> --- a/drivers/gpio/gpio-max77620.c
> +++ b/drivers/gpio/gpio-max77620.c
> @@ -123,7 +123,10 @@ static int max77620_gpio_get(struct gpio_chip *gc, unsigned int offset)
>                 return ret;
>         }
>
> -       return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
> +       if  (val & MAX77620_CNFG_GPIO_DIR_MASK)
> +               return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
> +       else
> +               return !!(val & MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK);

Looks sensible!

Reviewed-by: Alexandre Courbot <acourbot@...dia.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ