mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 22:14:04 +02:00
gpio: mockup: fix indicated direction
[ Upstream commitbff466bac5] Commit3edfb7bd76("gpiolib: Show correct direction from the beginning") fixed an existing issue but broke libgpiod tests by changing the default direction of dummy lines to output. We don't break user-space so make gpio-mockup behave as before. Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
b9284d6c30
commit
b8c51924b4
|
|
@ -32,8 +32,8 @@
|
|||
#define gpio_mockup_err(...) pr_err(GPIO_MOCKUP_NAME ": " __VA_ARGS__)
|
||||
|
||||
enum {
|
||||
GPIO_MOCKUP_DIR_OUT = 0,
|
||||
GPIO_MOCKUP_DIR_IN = 1,
|
||||
GPIO_MOCKUP_DIR_IN = 0,
|
||||
GPIO_MOCKUP_DIR_OUT = 1,
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
@ -135,7 +135,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_to_irq(struct gpio_chip *gc, unsigned int offset)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user