From: Jiri Kosina Date: Fri, 8 Apr 2011 23:43:18 +0000 (+0200) Subject: HID: hidraw: fix samples miscompilation X-Git-Tag: v3.0-rc1~345^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cb3e85fe19575cce8af82bc62a070c72e8f781b8;p=karo-tx-linux.git 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 Signed-off-by: Jiri Kosina --- 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 @@ #include #include +/* + * Ugly hack to work around failing compilation on systems that don't + * yet populate new version of hidraw.h to userspace. + * + * If you need this, please have your distro update the kernel headers. + */ +#ifndef HIDIOCSFEATURE +#define HIDIOCSFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x06, len) +#define HIDIOCGFEATURE(len) _IOC(_IOC_WRITE|_IOC_READ, 'H', 0x07, len) +#endif + /* Unix */ #include #include