Skip to contentSkip to conversation

Input: synaptics - make dmi_check_system return immediately when a match is found

PATCH In review Axel Lin 2 participants 2 messages Jul 11, 2011

Subsystems (2)
lore
Share & tools
lore

Axel Lin

author
#0 lore raw

PATCH 1/1 Input: synaptics - make dmi_check_system return immediately when a match is found

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.

---
 drivers/input/mouse/synaptics.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
drivers/input/mouse/synaptics.c +10 -2
index e06e045..09e7e0e 100644
@@ -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
 	{ }
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw
Quoted 4 lines · Axel Lin

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.

This adds too much noise for little gain... With other patches we already have callbacks defined, so it makes sense it apply them, this one I think I'll drop.

Thanks.

Signature · 1 line
Dmitry