summaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpiolib.c
diff options
context:
space:
mode:
authorAndy Shevchenko2018-07-09 20:47:21 +0200
committerLinus Walleij2018-07-13 09:01:46 +0200
commit809567905b5f10f73828b3fab3024bfaaf967f32 (patch)
tree3f48fdf55d107dd1e6c5c27545987c291a10dfb9 /drivers/gpio/gpiolib.c
parentgpiolib: Mark gpio_suffixes array with __maybe_unused (diff)
downloadkernel-qcow2-linux-809567905b5f10f73828b3fab3024bfaaf967f32.tar.gz
kernel-qcow2-linux-809567905b5f10f73828b3fab3024bfaaf967f32.tar.xz
kernel-qcow2-linux-809567905b5f10f73828b3fab3024bfaaf967f32.zip
gpiolib: Consistent use of ->get_direction() inside gpiolib
Two out of three calls to ->get_direction (excluding, of course, gpiod_get_direction() itself) are using gpiod_get_direction() and one is still open coded. Replace the latter one to use same API for sake of consistency. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpiolib.c')
-rw-r--r--drivers/gpio/gpiolib.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index a9a290999990..cbc071423f30 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -3260,18 +3260,13 @@ int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset)
* behind our back
*/
if (!chip->can_sleep && chip->get_direction) {
- int dir = chip->get_direction(chip, offset);
+ int dir = gpiod_get_direction(desc);
if (dir < 0) {
chip_err(chip, "%s: cannot get GPIO direction\n",
__func__);
return dir;
}
-
- if (dir)
- clear_bit(FLAG_IS_OUT, &desc->flags);
- else
- set_bit(FLAG_IS_OUT, &desc->flags);
}
if (test_bit(FLAG_IS_OUT, &desc->flags)) {