Commit d977e88a authored by Federico Vaga's avatar Federico Vaga

drv:gn412x_gpio: fix gpio_get_direction()

The following patch introduced a fix and a bug because I forgot to change
the negation:

7b3d1da4 drv:gn412x_gpio: fix direction get/set

Here we try to fix it, definitively.

To check, do:

  cat /sys/kernel/debug/gpio
Reported-by: Dimitris Lampridis's avatarDimitris Lampridis <dimitris.lampridis@cern.ch>
Signed-off-by: Federico Vaga's avatarFederico Vaga <federico.vaga@cern.ch>
parent b0d2f392
......@@ -202,7 +202,7 @@ static void gn412x_gpio_free(struct gpio_chip *chip, unsigned int offset)
static int gn412x_gpio_get_direction(struct gpio_chip *chip,
unsigned int offset)
{
return !gn412x_gpio_reg_read(chip, GNGPIO_DIRECTION_MODE, offset);
return !!gn412x_gpio_reg_read(chip, GNGPIO_DIRECTION_MODE, offset);
}
static int gn412x_gpio_direction_input(struct gpio_chip *chip,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment