drm.h: Fix DRM compilation with bare-metal toolchain
authorNishanth Menon <nm@ti.com>
Mon, 15 Apr 2013 22:35:35 +0000 (17:35 -0500)
committerPraneeth Bajjuri <praneeth@ti.com>
Tue, 16 Apr 2013 20:46:45 +0000 (15:46 -0500)
From: Paul Sokolovsky <paul.sokolovsky@linaro.org>

An ifdef in drm.h expects to be compiled with full-fledged Linux
toolchain, but it's common to compile kernel with just bare-metal
toolchain which doesn't define __linux__. So, also add __KERNEL__
check.

This fixes below error with arm-eabi-4.6

In file included from include/drm/drmP.h:75:0,
 from drivers/gpu/drm/drm_auth.c:36:
include/uapi/drm/drm.h:47:24: fatal error:
sys/ioccom.h: No such file or directory compilation terminated

[nm@ti.com: port forward to 3.9-rc6 and post to dri devel for feedback as RFC]
Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Praneeth Bajjuri <praneeth@ti.com>
include/uapi/drm/drm.h

index 8d1e2bbee83a97153cfc5ec8251345cea7a10cba..73a99e4664bef6f033b155d11053c52e7635e1e5 100644 (file)
@@ -36,7 +36,7 @@
 #ifndef _DRM_H_
 #define _DRM_H_
 
-#if defined(__linux__)
+#if defined(__KERNEL__) || defined(__linux__)
 
 #include <linux/types.h>
 #include <asm/ioctl.h>