Skip to content

Commit e84d1a4

Browse files
ihaAnas Nashif
authored andcommitted
drivers: gpio: Nios-II: Fix condition on gpio_nios2_config_oput_port()
(flags & GPIO_DIR_IN) is always zero because GPIO_DIR_IN is 0, then we have to use GPIO_DIR_MASK. Signed-off-by: Vitor Massaru Iha <[email protected]>
1 parent ec6188b commit e84d1a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpio/gpio_altera_nios2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct gpio_nios2_config {
3030
static int gpio_nios2_config_oput_port(struct device *dev, int access_op,
3131
u32_t pin, int flags)
3232
{
33-
if ((flags & GPIO_DIR_IN) || (flags & GPIO_INT)) {
33+
if (((flags & GPIO_DIR_MASK) == GPIO_DIR_IN) || (flags & GPIO_INT)) {
3434
return -ENOTSUP;
3535
}
3636

0 commit comments

Comments
 (0)