summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHector Palacios <hector.palacios@digi.com>2010-04-19 09:02:33 +0200
committerHector Palacios <hector.palacios@digi.com>2010-06-22 16:33:59 +0200
commite7708a44045df4a7b590f45745d6d8b30c41ef7d (patch)
tree95ef268df753362c83ffc36d335a220993daa5a2
parent6258fbb5686dc778fe16489fdb9896b0e065613b (diff)
spi: spidev_test gives error upon 1-byte transfer
The sample application spidev_test.c is using SPI_IOC_MESSAGE ioctl to do an SPI transfer. This ioctl returns the number of bytes successfully transmitted or a negative error code upon erroneous completion. The application however is returning an error if the result of the ioclt if the return value is 1. This makes the application to fail upon 1-byte length transfers. Signed-off-by: Hector Palacios <hector.palacios@digi.com>
-rw-r--r--Documentation/spi/spidev_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c
index c1a5aad3c75a..8c9d02e473d5 100644
--- a/Documentation/spi/spidev_test.c
+++ b/Documentation/spi/spidev_test.c
@@ -58,7 +58,7 @@ static void transfer(int fd)
};
ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
- if (ret == 1)
+ if (ret < 1)
pabort("can't send spi message");
for (ret = 0; ret < ARRAY_SIZE(tx); ret++) {