zhang / rpms / kernel

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