Commit b36dd3af authored by Sergio Paracuellos's avatar Sergio Paracuellos Committed by Greg Kroah-Hartman
Browse files

staging: mt7621-gpio: use ternary operator in return in mediatek_gpio_get_direction



This commits replaces if statement and two returns in favour
of a only one return using a ternary operator.

Signed-off-by: default avatarSergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: default avatarNeilBrown <neil@brown.name>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e9301a5a
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -135,10 +135,7 @@ mediatek_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
	t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
	spin_unlock_irqrestore(&rg->lock, flags);

	if (t & BIT(offset))
		return 0;

	return 1;
	return (t & BIT(offset)) ? 0 : 1;
}

static int