• Baruch Siach's avatar
    spi: spidev_test: fix build with musl libc · da6fe239
    Baruch Siach authored
    commit 8736f802 upstream.
    
    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: default avatarBaruch Siach <baruch@tkos.co.il>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    Cc: Ralph Sennhauser <ralph.sennhauser@gmail.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    da6fe239
spidev_test.c 8.31 KB