]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpio/gpio-mockup.c
scsi: target/core: Fix a race condition in the LUN lookup code
[mirror_ubuntu-bionic-kernel.git] / drivers / gpio / gpio-mockup.c
index 9532d86a82f7c8595a0a7fe0e7222937fde15acf..d99c8d8da9a050518b6d05dc3f9f3fff1c1eda8f 100644 (file)
@@ -35,8 +35,8 @@
 #define GPIO_MOCKUP_MAX_RANGES (GPIO_MOCKUP_MAX_GC * 2)
 
 enum {
-       GPIO_MOCKUP_DIR_OUT = 0,
-       GPIO_MOCKUP_DIR_IN = 1,
+       GPIO_MOCKUP_DIR_IN = 0,
+       GPIO_MOCKUP_DIR_OUT = 1,
 };
 
 /*
@@ -112,7 +112,7 @@ static int gpio_mockup_get_direction(struct gpio_chip *gc, unsigned int offset)
 {
        struct gpio_mockup_chip *chip = gpiochip_get_data(gc);
 
-       return chip->lines[offset].dir;
+       return !chip->lines[offset].dir;
 }
 
 static int gpio_mockup_name_lines(struct device *dev,