Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80956790 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Linus Walleij
Browse files

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent b23ec599
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -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)) {