Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262330AbTI1GkS (ORCPT ); Sun, 28 Sep 2003 02:40:18 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262332AbTI1GkS (ORCPT ); Sun, 28 Sep 2003 02:40:18 -0400 Received: from smtp1.fre.skanova.net ([195.67.227.94]:46581 "EHLO smtp1.fre.skanova.net") by vger.kernel.org with ESMTP id S262330AbTI1GkK (ORCPT ); Sun, 28 Sep 2003 02:40:10 -0400 To: Vojtech Pavlik Cc: Kernel Mailing List Subject: [PATCH] Only compile synaptics.c when enabled in config From: Peter Osterlund Date: 28 Sep 2003 08:40:01 +0200 Message-ID: Lines: 84 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Here is a patch that implements CONFIG_MOUSE_PS2_SYNAPTICS properly, so that the synaptics code is not included in the driver when synaptics support is disabled in .config. The patch also updates the Kconfig help text. linux-petero/drivers/input/mouse/Kconfig | 12 +++++------- linux-petero/drivers/input/mouse/Makefile | 3 ++- linux-petero/drivers/input/mouse/synaptics.c | 4 ---- linux-petero/drivers/input/mouse/synaptics.h | 7 +++++++ 4 files changed, 14 insertions(+), 12 deletions(-) diff -puN drivers/input/mouse/Kconfig~synaptics-config-cleanup drivers/input/mouse/Kconfig --- linux/drivers/input/mouse/Kconfig~synaptics-config-cleanup 2003-09-28 07:07:29.000000000 +0200 +++ linux-petero/drivers/input/mouse/Kconfig 2003-09-28 07:07:29.000000000 +0200 @@ -35,13 +35,11 @@ config MOUSE_PS2_SYNAPTICS Say Y here if you have a Synaptics TouchPad connected to your system. This touchpad is found on many modern laptop computers. - Note that you also need a user space driver to interpret the data - generated by the kernel. A compatible driver for XFree86 is available - from http://w1.894.telia.com/~u89404340/touchpad/index.html - - The gpm program is not yet able to interpret the data from this - driver, so if you need to use the touchpad in the console, you have to - say N for now. + Note that you also need a user space driver to take advantage of the + advanced features of the touchpad. A compatible driver for XFree86 is + available from http://w1.894.telia.com/~u89404340/touchpad/index.html + and a new version of GPM is available from + http://www.geocities.com/dt_or/gpm/gpm.html config MOUSE_SERIAL tristate "Serial mouse" diff -puN drivers/input/mouse/Makefile~synaptics-config-cleanup drivers/input/mouse/Makefile --- linux/drivers/input/mouse/Makefile~synaptics-config-cleanup 2003-09-28 07:07:29.000000000 +0200 +++ linux-petero/drivers/input/mouse/Makefile 2003-09-28 07:07:29.000000000 +0200 @@ -14,4 +14,5 @@ obj-$(CONFIG_MOUSE_PC9800) += 98busmouse obj-$(CONFIG_MOUSE_PS2) += psmouse.o obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o -psmouse-objs := psmouse-base.o logips2pp.o synaptics.o +psmouse-objs := psmouse-base.o logips2pp.o +psmouse-$(CONFIG_MOUSE_PS2_SYNAPTICS) += synaptics.o diff -puN drivers/input/mouse/synaptics.c~synaptics-config-cleanup drivers/input/mouse/synaptics.c --- linux/drivers/input/mouse/synaptics.c~synaptics-config-cleanup 2003-09-28 07:07:29.000000000 +0200 +++ linux-petero/drivers/input/mouse/synaptics.c 2003-09-28 07:07:29.000000000 +0200 @@ -375,10 +375,6 @@ int synaptics_init(struct psmouse *psmou { struct synaptics_data *priv; -#ifndef CONFIG_MOUSE_PS2_SYNAPTICS - return -1; -#endif - psmouse->private = priv = kmalloc(sizeof(struct synaptics_data), GFP_KERNEL); if (!priv) return -1; diff -puN drivers/input/mouse/synaptics.h~synaptics-config-cleanup drivers/input/mouse/synaptics.h --- linux/drivers/input/mouse/synaptics.h~synaptics-config-cleanup 2003-09-28 07:07:29.000000000 +0200 +++ linux-petero/drivers/input/mouse/synaptics.h 2003-09-28 07:07:29.000000000 +0200 @@ -10,10 +10,17 @@ #define _SYNAPTICS_H +#ifdef CONFIG_MOUSE_PS2_SYNAPTICS extern void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs); extern int synaptics_init(struct psmouse *psmouse); extern int synaptics_pt_init(struct psmouse *psmouse); extern void synaptics_disconnect(struct psmouse *psmouse); +#else +static inline void synaptics_process_byte(struct psmouse *psmouse, struct pt_regs *regs) {} +static inline int synaptics_init(struct psmouse *psmouse) { return -1; } +static inline int synaptics_pt_init(struct psmouse *psmouse) { return -1; } +static inline void synaptics_disconnect(struct psmouse *psmouse) {} +#endif /* synaptics queries */ #define SYN_QUE_IDENTIFY 0x00 _ -- Peter Osterlund - petero2@telia.com http://w1.894.telia.com/~u89404340 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/