[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMpxmJXv5+hegJX_m5Pw72O9Fiez++ELN6EqSP0MiPyrcm79Kw@mail.gmail.com>
Date: Mon, 28 Sep 2020 12:23:45 +0200
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
To: Ed Wildgoose <lists@...dgooses.com>
Cc: fe@....tdt.de, "Enrico Weigelt, metux IT consult" <info@...ux.net>,
Linus Walleij <linus.walleij@...aro.org>,
linux-gpio <linux-gpio@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpio: gpio-amd-fch: Correct logic of GPIO_LINE_DIRECTION
On Mon, Sep 28, 2020 at 11:45 AM Ed Wildgoose <lists@...dgooses.com> wrote:
>
> The original commit appears to have the logic reversed in
> amd_fch_gpio_get_direction. Also confirmed by observing the value of
> "direction" in the sys tree.
>
> Signed-off-by: Ed Wildgoose <lists@...dgooses.com>
> Fixes: e09d168f13f0 ("gpio: AMD G-Series PCH gpio driver")
> ---
> drivers/gpio/gpio-amd-fch.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-amd-fch.c b/drivers/gpio/gpio-amd-fch.c
> index 4e44ba4d7..2a21354ed 100644
> --- a/drivers/gpio/gpio-amd-fch.c
> +++ b/drivers/gpio/gpio-amd-fch.c
> @@ -92,7 +92,7 @@ static int amd_fch_gpio_get_direction(struct gpio_chip *gc, unsigned int gpio)
> ret = (readl_relaxed(ptr) & AMD_FCH_GPIO_FLAG_DIRECTION);
> spin_unlock_irqrestore(&priv->lock, flags);
>
> - return ret ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
> + return ret ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
> }
>
> static void amd_fch_gpio_set(struct gpio_chip *gc,
> --
> 2.26.2
>
Queued for fixes, thanks!
Bartosz
Powered by blists - more mailing lists