Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: exar: Set proper output level in exar_direction_output

Current code does not set output level in exar_direction_output, fix it.
Also move the direction_output/direction_input code block to avoid forward
declaration for exar_set_value().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Axel Lin and committed by
Linus Walleij
eddeae07 22c40367

+12 -11
+12 -11
drivers/gpio/gpio-exar.c
··· 59 59 return 0; 60 60 } 61 61 62 - static int exar_direction_output(struct gpio_chip *chip, unsigned int offset, 63 - int value) 64 - { 65 - return exar_set_direction(chip, 0, offset); 66 - } 67 - 68 - static int exar_direction_input(struct gpio_chip *chip, unsigned int offset) 69 - { 70 - return exar_set_direction(chip, 1, offset); 71 - } 72 - 73 62 static int exar_get(struct gpio_chip *chip, unsigned int reg) 74 63 { 75 64 struct exar_gpio_chip *exar_gpio = gpiochip_get_data(chip); ··· 103 114 104 115 addr = bank ? EXAR_OFFSET_MPIOLVL_HI : EXAR_OFFSET_MPIOLVL_LO; 105 116 exar_update(chip, addr, value, offset % 8); 117 + } 118 + 119 + static int exar_direction_output(struct gpio_chip *chip, unsigned int offset, 120 + int value) 121 + { 122 + exar_set_value(chip, offset, value); 123 + return exar_set_direction(chip, 0, offset); 124 + } 125 + 126 + static int exar_direction_input(struct gpio_chip *chip, unsigned int offset) 127 + { 128 + return exar_set_direction(chip, 1, offset); 106 129 } 107 130 108 131 static int gpio_exar_probe(struct platform_device *pdev)