From aae34327fedd0d8e0eb2a0ee048adc5c399b1b4b Mon Sep 17 00:00:00 2001 From: Konrad Kuchciak Date: Thu, 4 Oct 2018 11:54:36 +0200 Subject: [PATCH] gpio: don't ignore return codes when setting/unsetting interrupted cb Change-Id: Iaf3be22ee5939b6ff8ed239a803eabddd57e21dc Signed-off-by: Konrad Kuchciak --- src/peripheral_gpio.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/peripheral_gpio.c b/src/peripheral_gpio.c index eb2c999..addadc9 100644 --- a/src/peripheral_gpio.c +++ b/src/peripheral_gpio.c @@ -145,15 +145,11 @@ int peripheral_gpio_set_edge_mode(peripheral_gpio_h gpio, peripheral_gpio_edge_e */ int peripheral_gpio_set_interrupted_cb(peripheral_gpio_h gpio, peripheral_gpio_interrupted_cb callback, void *user_data) { - int ret = PERIPHERAL_ERROR_NONE; - RETVM_IF(__is_feature_supported() == false, PERIPHERAL_ERROR_NOT_SUPPORTED, "GPIO feature is not supported"); RETVM_IF(gpio == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "gpio handle is NULL"); RETVM_IF(callback == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "gpio interrupted callback is NULL"); - peripheral_interface_gpio_set_interrupted_cb(gpio, callback, user_data); - - return ret; + return peripheral_interface_gpio_set_interrupted_cb(gpio, callback, user_data); } /** @@ -161,14 +157,10 @@ int peripheral_gpio_set_interrupted_cb(peripheral_gpio_h gpio, peripheral_gpio_i */ int peripheral_gpio_unset_interrupted_cb(peripheral_gpio_h gpio) { - int ret = PERIPHERAL_ERROR_NONE; - RETVM_IF(__is_feature_supported() == false, PERIPHERAL_ERROR_NOT_SUPPORTED, "GPIO feature is not supported"); RETVM_IF(gpio == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "gpio handle is NULL"); - peripheral_interface_gpio_unset_interrupted_cb(gpio); - - return ret; + return peripheral_interface_gpio_unset_interrupted_cb(gpio); } /** -- 2.7.4