pio: don't return from close function too early 12/199412/3 accepted/tizen/unified/20190214.154127 submit/tizen/20190213.063316
authorKonrad Kuchciak <k.kuchciak@samsung.com>
Mon, 11 Feb 2019 07:45:18 +0000 (08:45 +0100)
committerKonrad Kuchciak <k.kuchciak@samsung.com>
Tue, 12 Feb 2019 12:21:15 +0000 (13:21 +0100)
We need to reach the end of the peripheral_xxx_close function in order
to free handle structure.

Change-Id: I51cf86a106397d52773875efe60424f662373c0f
Signed-off-by: Konrad Kuchciak <k.kuchciak@samsung.com>
src/peripheral_i2c.c
src/peripheral_pwm.c
src/peripheral_spi.c
src/peripheral_uart.c

index c36d72f..84bca0d 100644 (file)
@@ -91,10 +91,8 @@ int peripheral_i2c_close(peripheral_i2c_h i2c)
        RETVM_IF(i2c == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "i2c handle is NULL");
 
        ret = peripheral_gdbus_i2c_close(i2c);
-       if (ret != PERIPHERAL_ERROR_NONE) {
+       if (ret != PERIPHERAL_ERROR_NONE)
                _E("Failed to close i2c communcation, ret : %d", ret);
-               return ret;
-       }
 
        peripheral_interface_i2c_close(i2c);
 
index ee0e829..d6a306a 100644 (file)
@@ -83,10 +83,8 @@ int peripheral_pwm_close(peripheral_pwm_h pwm)
        RETVM_IF(pwm == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "pwm handle is NULL");
 
        ret = peripheral_gdbus_pwm_close(pwm);
-       if (ret != PERIPHERAL_ERROR_NONE) {
+       if (ret != PERIPHERAL_ERROR_NONE)
                _E("Failed to close PWM chip, continuing anyway, ret : %d", ret);
-               return ret;
-       }
 
        peripheral_interface_pwm_close(pwm);
 
index 10faddb..8b168e5 100644 (file)
@@ -82,10 +82,8 @@ int peripheral_spi_close(peripheral_spi_h spi)
        RETVM_IF(spi == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "spi handle is NULL");
 
        ret = peripheral_gdbus_spi_close(spi);
-       if (ret != PERIPHERAL_ERROR_NONE) {
+       if (ret != PERIPHERAL_ERROR_NONE)
                _E("Failed to close SPI device, continuing anyway, ret : %d", ret);
-               return ret;
-       }
 
        peripheral_interface_spi_close(spi);
 
index 2b48f85..b572f83 100644 (file)
@@ -87,10 +87,8 @@ int peripheral_uart_close(peripheral_uart_h uart)
        RETVM_IF(uart == NULL, PERIPHERAL_ERROR_INVALID_PARAMETER, "uart handle is NULL");
 
        ret = peripheral_gdbus_uart_close(uart);
-       if (ret != PERIPHERAL_ERROR_NONE) {
+       if (ret != PERIPHERAL_ERROR_NONE)
                _E("Failed to close uart communication, continuing anyway, ret : %d", ret);
-               return ret;
-       }
 
        peripheral_interface_uart_close(uart);