提交 7d264917 编写于 作者: J Joey Gouly 提交者: Linus Walleij

pinctrl: apple: make apple_gpio_get_direction more readable

Try to make this more readable by not using a long line with
a ternary operator.
Signed-off-by: NJoey Gouly <joey.gouly@arm.com>
Suggested-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211121165642.27883-7-joey.gouly@arm.comSigned-off-by: NLinus Walleij <linus.walleij@linaro.org>
上级 3605f104
......@@ -194,8 +194,9 @@ static int apple_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
unsigned int reg = apple_gpio_get_reg(pctl, offset);
return (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) ?
GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
if (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT)
return GPIO_LINE_DIRECTION_OUT;
return GPIO_LINE_DIRECTION_IN;
}
static int apple_gpio_get(struct gpio_chip *chip, unsigned offset)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册