a76ecf0
From 0eadbb65c0026fb4eec89c54f6b48a0febd87f92 Mon Sep 17 00:00:00 2001
a76ecf0
From: Laura Abbott <labbott@redhat.com>
a76ecf0
Date: Fri, 9 Sep 2016 08:19:17 -0700
a76ecf0
Subject: [PATCH] iio: Use type header from kernel tree
a76ecf0
MIME-Version: 1.0
a76ecf0
Content-Type: text/plain; charset=UTF-8
a76ecf0
Content-Transfer-Encoding: 8bit
a76ecf0
To: Jonathan Cameron <jic23@kernel.org>
a76ecf0
To: Hartmut Knaack <knaack.h@gmx.de>
a76ecf0
To: Lars-Peter Clausen <lars@metafoo.de>
a76ecf0
To: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
a76ecf0
Cc: linux-iio@vger.kernel.org
a76ecf0
Cc: linux-kernel@vger.kernel.org
a76ecf0
a76ecf0
a76ecf0
The iio tools have been updated as new event types have been added to
a76ecf0
the kernel. The tools currently use the standard system headers which
a76ecf0
means that the system may not have the newest defintitions. This leads
a76ecf0
to build failures when building newer tools on older hosts:
a76ecf0
a76ecf0
gcc -Wall -g -D_GNU_SOURCE   -c -o iio_event_monitor.o
a76ecf0
iio_event_monitor.c
a76ecf0
iio_event_monitor.c:59:3: error: ‘IIO_UVINDEX’ undeclared here (not in a
a76ecf0
function)
a76ecf0
  [IIO_UVINDEX] = "uvindex",
a76ecf0
   ^~~~~~~~~~~
a76ecf0
iio_event_monitor.c:59:3: error: array index in initializer not of
a76ecf0
integer type
a76ecf0
iio_event_monitor.c:59:3: note: (near initialization for
a76ecf0
‘iio_chan_type_name_spec’)
a76ecf0
iio_event_monitor.c:97:3: error: ‘IIO_MOD_LIGHT_UV’ undeclared here (not
a76ecf0
in a function)
a76ecf0
  [IIO_MOD_LIGHT_UV] = "uv",
a76ecf0
   ^~~~~~~~~~~~~~~~
a76ecf0
iio_event_monitor.c:97:3: error: array index in initializer not of
a76ecf0
integer type
a76ecf0
iio_event_monitor.c:97:3: note: (near initialization for
a76ecf0
‘iio_modifier_names’)
a76ecf0
<builtin>: recipe for target 'iio_event_monitor.o' failed
a76ecf0
a76ecf0
Switch to using the header from the kernel tree to ensure the newest
a76ecf0
defintions are always picked up.
a76ecf0
a76ecf0
Signed-off-by: Laura Abbott <labbott@redhat.com>
a76ecf0
---
a76ecf0
 tools/iio/iio_event_monitor.c | 2 +-
a76ecf0
 1 file changed, 1 insertion(+), 1 deletion(-)
a76ecf0
a76ecf0
diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c
a76ecf0
index d9b7e0f..f02523d 100644
a76ecf0
--- a/tools/iio/iio_event_monitor.c
a76ecf0
+++ b/tools/iio/iio_event_monitor.c
a76ecf0
@@ -26,7 +26,7 @@
a76ecf0
 #include <sys/ioctl.h>
a76ecf0
 #include "iio_utils.h"
a76ecf0
 #include <linux/iio/events.h>
a76ecf0
-#include <linux/iio/types.h>
a76ecf0
+#include "../../include/uapi/linux/iio/types.h"
a76ecf0
 
a76ecf0
 static const char * const iio_chan_type_name_spec[] = {
a76ecf0
 	[IIO_VOLTAGE] = "voltage",
a76ecf0
-- 
a76ecf0
2.7.4
a76ecf0