From e63c6cc325f2cd3c3881dbf20a1bd3d788782060 Mon Sep 17 00:00:00 2001 From: Peter Bigot Date: Wed, 29 Jan 2020 08:22:44 -0600 Subject: [PATCH] gpio: replace GPIO_INT_LEVEL flag This will be deprecated, use the generalized mode flag or absence of GPIO_INT_EDGE. Signed-off-by: Peter Bigot --- drivers/gpio/gpio_cc32xx.c | 2 +- .../gpio/gpio_basic_api/src/test_callback_trigger.c | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpio/gpio_cc32xx.c b/drivers/gpio/gpio_cc32xx.c index a24de7a8dfa..1811bb33535 100644 --- a/drivers/gpio/gpio_cc32xx.c +++ b/drivers/gpio/gpio_cc32xx.c @@ -227,7 +227,7 @@ static int gpio_cc32xx_pin_interrupt_configure(struct device *port, } else { int_type = GPIO_FALLING_EDGE; } - } else { /* GPIO_INT_LEVEL */ + } else { /* GPIO_INT_MODE_LEVEL */ if (trig == GPIO_INT_TRIG_HIGH) { int_type = GPIO_HIGH_LEVEL; } else { diff --git a/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c b/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c index 788b2c39d5e..40de70e7552 100644 --- a/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c +++ b/tests/drivers/gpio/gpio_basic_api/src/test_callback_trigger.c @@ -105,15 +105,13 @@ static int test_callback(int mode) } if ((mode & GPIO_INT_EDGE) == GPIO_INT_EDGE) { if (cb_cnt != 1) { - TC_ERROR("not trigger callback correctly\n"); + TC_ERROR("edge not trigger callback correctly\n"); goto err_exit; } goto pass_exit; - } - - if ((mode & GPIO_INT_EDGE) == GPIO_INT_LEVEL) { + } else { if (cb_cnt != MAX_INT_CNT) { - TC_ERROR("not trigger callback correctly\n"); + TC_ERROR("level not trigger callback correctly\n"); goto err_exit; } }