diff options
author | Hector Palacios <hector.palacios@digi.com> | 2010-04-29 18:02:28 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2010-04-29 18:40:30 -0400 |
commit | 95b1ed2ac7ffe3205afc6f5a20320fbdb984da92 (patch) | |
tree | 774300dd52221307133f6bf9fd61c398bce8d0e1 /Documentation/spi | |
parent | dda04c7bcf58cb02ac796beb1cf483aa5277f2af (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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'Documentation/spi')
-rw-r--r-- | Documentation/spi/spidev_test.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Documentation/spi/spidev_test.c b/Documentation/spi/spidev_test.c index 10abd3773e49..16feda901469 100644 --- a/Documentation/spi/spidev_test.c +++ b/Documentation/spi/spidev_test.c | |||
@@ -58,7 +58,7 @@ static void transfer(int fd) | |||
58 | }; | 58 | }; |
59 | 59 | ||
60 | ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); | 60 | ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr); |
61 | if (ret == 1) | 61 | if (ret < 1) |
62 | pabort("can't send spi message"); | 62 | pabort("can't send spi message"); |
63 | 63 | ||
64 | for (ret = 0; ret < ARRAY_SIZE(tx); ret++) { | 64 | for (ret = 0; ret < ARRAY_SIZE(tx); ret++) { |