diff options
author | Jiri Kosina <jkosina@suse.cz> | 2011-04-08 19:43:18 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-04-08 19:43:18 -0400 |
commit | cb3e85fe19575cce8af82bc62a070c72e8f781b8 (patch) | |
tree | 4edd10237fd2fed23caf1044a12bae07cf2e8b69 /samples | |
parent | 1a978c50c6cff743c3516ffa6d2ce44382e7b70b (diff) |
HID: hidraw: fix samples miscompilation
On systems where userspace doesn't have new hidraw.h populated to
/usr/include, the hidraw sample won't compile as it's missing the new
ioctl defitions.
Introduce temporary ugly workaround to define the ioctls "manually"
in such cases, just to avoid miscompilation in allmodconfig cases.
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/hidraw/hid-example.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/samples/hidraw/hid-example.c b/samples/hidraw/hid-example.c index 40e3d6200582..816e2dcda7ca 100644 --- a/samples/hidraw/hid-example.c +++ b/samples/hidraw/hid-example.c | |||
@@ -14,6 +14,17 @@ | |||
14 | #include <linux/input.h> | 14 | #include <linux/input.h> |
15 | #include <linux/hidraw.h> | 15 | #include <linux/hidraw.h> |
16 | 16 | ||
17 | /* | ||
18 | * Ugly hack to work around failing compilation on systems that don't | ||
19 | * yet populate new version of hidraw.h to userspace. | ||
20 | * | ||
21 | * If you need this, please have your distro update the kernel headers. | ||
22 | */ | ||
23 | #ifndef HIDIOCSFEATURE | ||
24 | #define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) | ||
25 | #define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len) | ||
26 | #endif | ||
27 | |||
17 | /* Unix */ | 28 | /* Unix */ |
18 | #include <sys/ioctl.h> | 29 | #include <sys/ioctl.h> |
19 | #include <sys/types.h> | 30 | #include <sys/types.h> |