Skip to content

Commit

Permalink
spi: spidev_test: fix build with musl libc
Browse files Browse the repository at this point in the history
spidev.h uses _IOC_SIZEBITS directly. musl libc does not provide this macro
unless linux/ioctl.h is included explicitly. Fixes build failures like:

In file included from .../host/usr/arm-buildroot-linux-musleabihf/sysroot/usr/include/sys/ioctl.h:7:0,
                 from .../build/spidev_test-v3.15/spidev_test.c:20:
.../build/spidev_test-v3.15/spidev_test.c: In function ‘transfer’:
.../build/spidev_test-v3.15/spidev_test.c:75:18: error: ‘_IOC_SIZEBITS’ undeclared (first use in this function)
  ret = ioctl(fd, SPI_IOC_MESSAGE(1), &tr);
                  ^

Signed-off-by: Baruch Siach <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
baruchsiach authored and broonie committed Aug 15, 2016
1 parent a43cd4b commit 8736f80
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tools/spi/spidev_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/ioctl.h>
#include <sys/stat.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
Expand Down

0 comments on commit 8736f80

Please sign in to comment.