xref: /OK3568_Linux_fs/buildroot/package/lcdproc/0002-Add-missing-ioctl-header.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 6267665454501512ac054202b38e4e6a72fa284b Mon Sep 17 00:00:00 2001
2From: Baruch Siach <baruch@tkos.co.il>
3Date: Fri, 8 Sep 2017 14:19:11 +0300
4Subject: [PATCH] Add missing ioctl header
5
6The spidev.h header uses macros from linux/ioctl.h. Add this header
7explicitly since some libc, like musl, do not include it implicitly.
8This fixes the following build failure:
9
10In file included from .../sysroot/usr/include/sys/ioctl.h:7:0,
11                 from hd44780-spi.c:31:
12hd44780-spi.c: In function ‘spi_transfer’:
13hd44780-spi.c:89:24: error: ‘_IOC_SIZEBITS’ undeclared (first use in this function)
14  status = ioctl(p->fd, SPI_IOC_MESSAGE(1), &xfer);
15                        ^
16Signed-off-by: Baruch Siach <baruch@tkos.co.il>
17---
18Upstream status: https://github.com/lcdproc/lcdproc/pull/90
19
20 server/drivers/hd44780-pifacecad.c | 1 +
21 server/drivers/hd44780-spi.c       | 1 +
22 2 files changed, 2 insertions(+)
23
24diff --git a/server/drivers/hd44780-pifacecad.c b/server/drivers/hd44780-pifacecad.c
25index a73b9f9b1f82..55139124d852 100644
26--- a/server/drivers/hd44780-pifacecad.c
27+++ b/server/drivers/hd44780-pifacecad.c
28@@ -54,6 +54,7 @@
29 #include <unistd.h>
30 #include <fcntl.h>
31 #include <sys/ioctl.h>
32+#include <linux/ioctl.h>
33 #include <stdint.h>
34 #include <linux/spi/spidev.h>
35
36diff --git a/server/drivers/hd44780-spi.c b/server/drivers/hd44780-spi.c
37index 791156f87a26..74c85fb014aa 100644
38--- a/server/drivers/hd44780-spi.c
39+++ b/server/drivers/hd44780-spi.c
40@@ -29,6 +29,7 @@
41 #include <unistd.h>
42 #include <fcntl.h>
43 #include <sys/ioctl.h>
44+#include <linux/ioctl.h>
45 #include <stdint.h>
46 #include <linux/spi/spidev.h>
47
48--
492.14.1
50
51