aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-raspberrypi-exp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpio/gpio-raspberrypi-exp.c')
-rw-r--r--drivers/gpio/gpio-raspberrypi-exp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-raspberrypi-exp.c b/drivers/gpio/gpio-raspberrypi-exp.c
index b77ea16ffa03..bb100e0124e6 100644
--- a/drivers/gpio/gpio-raspberrypi-exp.c
+++ b/drivers/gpio/gpio-raspberrypi-exp.c
@@ -147,7 +147,10 @@ static int rpi_exp_gpio_get_direction(struct gpio_chip *gc, unsigned int off)
get.gpio);
return ret ? ret : -EIO;
}
- return !get.direction;
+ if (get.direction)
+ return GPIO_LINE_DIRECTION_OUT;
+
+ return GPIO_LINE_DIRECTION_IN;
}
static int rpi_exp_gpio_get(struct gpio_chip *gc, unsigned int off)