]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: mpc8xxx: Fixup setting gpio direction output
authorAxel Lin <axel.lin@ingics.com>
Mon, 22 Feb 2016 07:22:52 +0000 (15:22 +0800)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 9 Mar 2016 03:41:23 +0000 (10:41 +0700)
commita86dfdadd1d0e9a1d417a7581abf9f7ce7ef6da6
tree3423b11e0375a5a398890031ecb048737a536eb8
parent50d848c77b5e0157d7cebe2f6ad5d33c90e6f48b
gpio: mpc8xxx: Fixup setting gpio direction output

For devtype with specific gpio_dir_out implementation, current code is
wrong because below code sets both gc->direction_output and
mpc8xxx_gc->direction_output to the same function.

gc->direction_output = devtype->gpio_dir_out ?: gc->direction_output;
mpc8xxx_gc->direction_output = gc->direction_output;

Set mpc8xxx_gc->direction_output = gc->direction_output first to fix it.
This way mpc8xxx_gc->direction_output actually calls the standard
bgpio_dir_out() to update register.

Fixes: commit e0f2e2baf205 ("drivers/gpio: Switch gpio-mpc8xxx to use gpio-generic")
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-mpc8xxx.c