Skip to content

Commit d3054ba

Browse files
andy-shevbrgl
authored andcommitted
gpio: 74xx-mmio: Check MMIO_74XX_DIR_IN flag in mmio_74xx_dir_in()
It's logically better to check the IN in ->direction_input() and _OUT in ->direction_output(). While at it, replace ternary with plain if-conditional for the sake of consistency with mmio_74xx_dir_out(). Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 10fcd2f commit d3054ba

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/gpio/gpio-74xx-mmio.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ static int mmio_74xx_dir_in(struct gpio_chip *gc, unsigned int gpio)
8888
{
8989
struct mmio_74xx_gpio_priv *priv = gpiochip_get_data(gc);
9090

91-
return (priv->flags & MMIO_74XX_DIR_OUT) ? -ENOTSUPP : 0;
91+
if (priv->flags & MMIO_74XX_DIR_IN)
92+
return 0;
93+
94+
return -ENOTSUPP;
9295
}
9396

9497
static int mmio_74xx_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)

0 commit comments

Comments
 (0)