diff options
author | Joey Gouly <joey.gouly@arm.com> | 2021-11-21 19:56:37 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-11-27 02:55:14 +0300 |
commit | 7d2649172908c83c820a957e97d0baf9901b9c95 (patch) | |
tree | 57c823c5e62facbd058432d80e8b0dc2ea56705c /drivers/pinctrl/pinctrl-apple-gpio.c | |
parent | 3605f104111e4adeac71edc89d867ec56147786d (diff) | |
download | linux-7d2649172908c83c820a957e97d0baf9901b9c95.tar.xz |
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: Joey Gouly <joey.gouly@arm.com>
Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Link: https://lore.kernel.org/r/20211121165642.27883-7-joey.gouly@arm.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-apple-gpio.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-apple-gpio.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-apple-gpio.c b/drivers/pinctrl/pinctrl-apple-gpio.c index bd7f28150ac0..fba2d4ec383c 100644 --- a/drivers/pinctrl/pinctrl-apple-gpio.c +++ b/drivers/pinctrl/pinctrl-apple-gpio.c @@ -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) |