All of lore.kernel.org
 help / color / mirror / Atom feed
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Alessandro Rubini <rubini@ipvvis.unipv.it>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org
Subject: [PATCH] Input: synaptics - make dmi_check_system return immediately when a match is found
Date: Mon, 11 Jul 2011 22:41:36 +0800	[thread overview]
Message-ID: <1310395296.2415.7.camel@phoenix> (raw)

We only care about if there is any successful match from the table
or no match at all, make the dmi_matched callback return 1 then
dmi_check_system will return immediately if we have a successful match.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/input/mouse/synaptics.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index e06e045..09e7e0e 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -801,6 +801,11 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 	return 0;
 }
 
+static int __init dmi_matched(const struct dmi_system_id *dmi)
+{
+	return 1;
+}
+
 static bool impaired_toshiba_kbc;
 
 static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
@@ -811,6 +816,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
 		},
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Dynabook */
@@ -818,6 +824,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"),
 		},
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Portege M300 */
@@ -825,7 +832,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"),
 		},
-
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Portege M300 */
@@ -834,7 +841,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"),
 			DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"),
 		},
-
+		.callback = dmi_matched,
 	},
 #endif
 	{ }
@@ -850,6 +857,7 @@ static const struct dmi_system_id __initconst olpc_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
 		},
+		.callback = dmi_matched,
 	},
 #endif
 	{ }
-- 
1.7.4.1




WARNING: multiple messages have this Message-ID (diff)
From: Axel Lin <axel.lin@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Alessandro Rubini <rubini@cvml.unipv.it>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org
Subject: [PATCH] Input: synaptics - make dmi_check_system return immediately when a match is found
Date: Mon, 11 Jul 2011 22:41:36 +0800	[thread overview]
Message-ID: <1310395296.2415.7.camel@phoenix> (raw)

We only care about if there is any successful match from the table
or no match at all, make the dmi_matched callback return 1 then
dmi_check_system will return immediately if we have a successful match.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/input/mouse/synaptics.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index e06e045..09e7e0e 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -801,6 +801,11 @@ static int synaptics_reconnect(struct psmouse *psmouse)
 	return 0;
 }
 
+static int __init dmi_matched(const struct dmi_system_id *dmi)
+{
+	return 1;
+}
+
 static bool impaired_toshiba_kbc;
 
 static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
@@ -811,6 +816,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "Satellite"),
 		},
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Dynabook */
@@ -818,6 +824,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "dynabook"),
 		},
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Portege M300 */
@@ -825,7 +832,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M300"),
 		},
-
+		.callback = dmi_matched,
 	},
 	{
 		/* Toshiba Portege M300 */
@@ -834,7 +841,7 @@ static const struct dmi_system_id __initconst toshiba_dmi_table[] = {
 			DMI_MATCH(DMI_PRODUCT_NAME, "Portable PC"),
 			DMI_MATCH(DMI_PRODUCT_VERSION, "Version 1.0"),
 		},
-
+		.callback = dmi_matched,
 	},
 #endif
 	{ }
@@ -850,6 +857,7 @@ static const struct dmi_system_id __initconst olpc_dmi_table[] = {
 			DMI_MATCH(DMI_SYS_VENDOR, "OLPC"),
 			DMI_MATCH(DMI_PRODUCT_NAME, "XO"),
 		},
+		.callback = dmi_matched,
 	},
 #endif
 	{ }
-- 
1.7.4.1




             reply	other threads:[~2011-07-11 14:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11 14:41 Axel Lin [this message]
2011-07-11 14:41 ` [PATCH] Input: synaptics - make dmi_check_system return immediately when a match is found Axel Lin
2011-07-11 16:44 ` Dmitry Torokhov
2011-07-11 16:44   ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1310395296.2415.7.camel@phoenix \
    --to=axel.lin@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rubini@ipvvis.unipv.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.