[PATCH 1/4] Lifebook: dmi on x86 only

From: Dmitry Torokhov
Date: Tue Mar 22 2005 - 02:21:51 EST


===================================================================

Input: lifebook - DMI facility is only available on i386, do not
attempt to compile on anything else.

Signed-off-by: Dmitry Torokhov <dtor@xxxxxxx>


lifebook.c | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)

Index: dtor/drivers/input/mouse/lifebook.c
===================================================================
--- dtor.orig/drivers/input/mouse/lifebook.c
+++ dtor/drivers/input/mouse/lifebook.c
@@ -15,17 +15,17 @@
#include <linux/input.h>
#include <linux/serio.h>
#include <linux/libps2.h>
-#include <linux/dmi.h>

#include "psmouse.h"
#include "lifebook.h"

static int max_y = 1024;

-
+#if defined(__i386__)
+#include <linux/dmi.h>
static struct dmi_system_id lifebook_dmi_table[] = {
{
- .ident = "Fujitsu Siemens Lifebook B-Sereis",
+ .ident = "Lifebook",
.matches = {
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK B Series"),
},
@@ -33,6 +33,13 @@ static struct dmi_system_id lifebook_dmi
{ }
};

+static inline int lifebook_check_dmi(void)
+{
+ return dmi_check_system(lifebook_dmi_table) ? 0 : -1;
+}
+#else
+static inline int lifebook_check_dmi(void) { return -1; }
+#endif

static psmouse_ret_t lifebook_process_byte(struct psmouse *psmouse, struct pt_regs *regs)
{
@@ -102,8 +109,7 @@ static void lifebook_disconnect(struct p
int lifebook_detect(struct psmouse *psmouse, unsigned int max_proto,
int set_properties)
{
- if (!dmi_check_system(lifebook_dmi_table) &&
- (max_proto != PSMOUSE_LIFEBOOK) )
+ if (lifebook_check_dmi() && max_proto != PSMOUSE_LIFEBOOK)
return -1;

if (set_properties) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/