Skip to content

Commit

Permalink
spi: uapi: spidev: add missing ioctl header
Browse files Browse the repository at this point in the history
The SPI_IOC_MESSAGE() macro references _IOC_SIZEBITS. Add linux/ioctl.h
to make sure this macro is defined. This fixes the following build
failure of lcdproc with the musl libc:

In file included from .../sysroot/usr/include/sys/ioctl.h:7:0,
                 from hd44780-spi.c:31:
hd44780-spi.c: In function 'spi_transfer':
hd44780-spi.c:89:24: error: '_IOC_SIZEBITS' undeclared (first use in this function)
  status = ioctl(p->fd, SPI_IOC_MESSAGE(1), &xfer);
                        ^

Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org
  • Loading branch information
baruchsiach authored and broonie committed Sep 13, 2017
1 parent ecb478b commit a2b4a79
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/uapi/linux/spi/spidev.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define SPIDEV_H

#include <linux/types.h>
#include <linux/ioctl.h>

/* User space versions of kernel symbols for SPI clocking modes,
* matching <linux/spi/spi.h>
Expand Down

0 comments on commit a2b4a79

Please sign in to comment.