[PATCH 1/5] OLPC: Fix up the olpc.h defines to handle !CONFIG_OLPC
Jordan Crouse
jordan.crouse at amd.com
Wed Apr 25 20:31:22 EDT 2007
From: Jordan Crouse <jordan.crouse at amd.com>
To keep from going crazy with #if CONFIG_OLPC lines in the code, we
define the OLPC detection functions to return false when #ifndef
CONFIG_OLPC.
Signed-off-by: Jordan Crouse <jordan.crouse at amd.com>
---
include/asm-i386/olpc.h | 15 +++++++++++++--
1 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/include/asm-i386/olpc.h b/include/asm-i386/olpc.h
index 6f57871..17227f4 100644
--- a/include/asm-i386/olpc.h
+++ b/include/asm-i386/olpc.h
@@ -11,8 +11,6 @@ struct olpc_platform_t {
int ecver;
};
-extern struct olpc_platform_t olpc_platform_info;
-
#define OLPC_F_PRESENT 0x01
#define OLPC_F_DCON 0x02
#define OLPC_F_VSA 0x04
@@ -26,6 +24,17 @@ enum
OLPC_REV_UNKNOWN /* this should always come last */
};
+#ifndef CONFIG_OLPC
+
+static inline int machine_is_olpc(void) { return 0; }
+static inline int olpc_has_dcon(void) { return 0; }
+static inline int olpc_has_vsa(void) { return 0; }
+static inline int olpc_get_rev(void) { return OLPC_REV_UNKNOWN; }
+
+#else
+
+extern struct olpc_platform_t olpc_platform_info;
+
static inline int
machine_is_olpc(void)
{
@@ -50,6 +59,8 @@ olpc_get_rev(void)
return olpc_platform_info.boardrev;
}
+#endif
+
/* EC functions */
int lock_ec(void);
More information about the Devel
mailing list