Skip to content
Permalink
Browse files

drivers: gpio_c13xx_cc26xx: fix control flow issue

The value of GPIO_INT_ACTIVE_LOW is 0, so the bit checking if statement
is never executed. Use GPIO_INT_ACTIVE_HIGH when checking this bit.

Fixes #16162

Signed-off-by: Brett Witherspoon <spoonb@cdspooner.com>
  • Loading branch information...
bwitherspoon authored and galak committed May 15, 2019
1 parent 9b6c2f4 commit 61fb6b468d016ef77fa9022fd75514ec88bbedf4
Showing with 3 additions and 3 deletions.
  1. +3 −3 drivers/gpio/gpio_cc13xx_cc26xx.c
@@ -45,10 +45,10 @@ static int gpio_cc13xx_cc26xx_config(struct device *port, int access_op,
if (flags & GPIO_INT_EDGE) {
if (flags & GPIO_INT_DOUBLE_EDGE) {
config |= IOC_BOTH_EDGES;
} else if (flags & GPIO_INT_ACTIVE_LOW) {
config |= IOC_FALLING_EDGE;
} else {
} else if (flags & GPIO_INT_ACTIVE_HIGH) {
config |= IOC_RISING_EDGE;
} else { /* GPIO_INT_ACTIVE_LOW */
config |= IOC_FALLING_EDGE;
}
} else {
return -ENOTSUP;

0 comments on commit 61fb6b4

Please sign in to comment.
You can’t perform that action at this time.