Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git] / drivers / gpio / gpio-pl061.c
index 722ce5c..5df7782 100644 (file)
@@ -63,7 +63,10 @@ static int pl061_get_direction(struct gpio_chip *gc, unsigned offset)
 {
        struct pl061 *pl061 = gpiochip_get_data(gc);
 
-       return !(readb(pl061->base + GPIODIR) & BIT(offset));
+       if (readb(pl061->base + GPIODIR) & BIT(offset))
+               return GPIO_LINE_DIRECTION_OUT;
+
+       return GPIO_LINE_DIRECTION_IN;
 }
 
 static int pl061_direction_input(struct gpio_chip *gc, unsigned offset)