spi: exclude the positive value in the ioctl error check, becasue of the ioctl return... 51/164451/1
authorSegwon <segwon.han@samsung.com>
Tue, 19 Dec 2017 06:31:25 +0000 (15:31 +0900)
committerSegwon <segwon.han@samsung.com>
Tue, 19 Dec 2017 06:31:25 +0000 (15:31 +0900)
Change-Id: If7d4d517c519f6d41c6bde7a7716edda4cd6a25a
Signed-off-by: Segwon <segwon.han@samsung.com>
src/interface/peripheral_interface_spi.c

index 15baf4bdbace458932bcfde22e6720206a052ae5..b38436b93111cd56897309aee2036ab085af62dc 100644 (file)
@@ -66,7 +66,7 @@ int peripheral_interface_spi_read(peripheral_spi_h spi, uint8_t *rxbuf, uint32_t
        xfer.len = length;
 
        ret = ioctl(spi->fd, SPI_IOC_MESSAGE(1), &xfer);
-       CHECK_ERROR(ret != 0);
+       CHECK_ERROR(ret < 0);
 
        return PERIPHERAL_ERROR_NONE;
 }
@@ -81,7 +81,7 @@ int peripheral_interface_spi_write(peripheral_spi_h spi, uint8_t *txbuf, uint32_
        xfer.len = length;
 
        ret = ioctl(spi->fd, SPI_IOC_MESSAGE(1), &xfer);
-       CHECK_ERROR(ret != 0);
+       CHECK_ERROR(ret < 0);
 
        return PERIPHERAL_ERROR_NONE;
 }
@@ -99,7 +99,7 @@ int peripheral_interface_spi_transfer(peripheral_spi_h spi, uint8_t *txbuf, uint
        xfer.len = length;
 
        ret = ioctl(spi->fd, SPI_IOC_MESSAGE(1), &xfer);
-       CHECK_ERROR(ret != 0);
+       CHECK_ERROR(ret < 0);
 
        return PERIPHERAL_ERROR_NONE;
 }