From: Segwon Date: Tue, 19 Dec 2017 06:31:25 +0000 (+0900) Subject: spi: exclude the positive value in the ioctl error check, becasue of the ioctl return... X-Git-Tag: submit/tizen_4.0/20171220.125806^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=24403e78dd985555bf2e35a04d9c9ed3e41eaa45;p=platform%2Fcore%2Fapi%2Fperipheral-io.git spi: exclude the positive value in the ioctl error check, becasue of the ioctl return length Change-Id: If7d4d517c519f6d41c6bde7a7716edda4cd6a25a Signed-off-by: Segwon --- diff --git a/src/interface/peripheral_interface_spi.c b/src/interface/peripheral_interface_spi.c index 15baf4b..b38436b 100644 --- a/src/interface/peripheral_interface_spi.c +++ b/src/interface/peripheral_interface_spi.c @@ -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; }