gpio: don't ignore return codes when setting/unsetting interrupted cb 44/190644/1
authorKonrad Kuchciak <k.kuchciak@samsung.com>
Thu, 4 Oct 2018 09:54:36 +0000 (11:54 +0200)
committerKonrad Kuchciak <k.kuchciak@samsung.com>
Thu, 4 Oct 2018 10:08:06 +0000 (12:08 +0200)
Change-Id: Iaf3be22ee5939b6ff8ed239a803eabddd57e21dc
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
src/peripheral_gpio.c

index eb2c9996ff978e40c0deee7d52b0f1f524aa7dbf..addadc959fa986159b4a02055eff2b13f52899f2 100644 (file)
@@ -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);
 }
 
 /**