Skip to content
Snippets Groups Projects
Commit 7d264917 authored by Joey Gouly's avatar Joey Gouly Committed by Linus Walleij
Browse files

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: default avatarJoey Gouly <joey.gouly@arm.com>
Suggested-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211121165642.27883-7-joey.gouly@arm.com


Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 3605f104
No related branches found
No related tags found
No related merge requests found
...@@ -194,8 +194,9 @@ static int apple_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) ...@@ -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); struct apple_gpio_pinctrl *pctl = gpiochip_get_data(chip);
unsigned int reg = apple_gpio_get_reg(pctl, offset); unsigned int reg = apple_gpio_get_reg(pctl, offset);
return (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT) ? if (FIELD_GET(REG_GPIOx_MODE, reg) == REG_GPIOx_OUT)
GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN; return GPIO_LINE_DIRECTION_OUT;
return GPIO_LINE_DIRECTION_IN;
} }
static int apple_gpio_get(struct gpio_chip *chip, unsigned offset) static int apple_gpio_get(struct gpio_chip *chip, unsigned offset)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment