From patchwork Mon Jul 11 14:41:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: axel lin X-Patchwork-Id: 965262 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p6BEeXRS018671 for ; Mon, 11 Jul 2011 14:41:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752653Ab1GKOln (ORCPT ); Mon, 11 Jul 2011 10:41:43 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:39235 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752051Ab1GKOlm (ORCPT ); Mon, 11 Jul 2011 10:41:42 -0400 Received: by vws1 with SMTP id 1so2738750vws.19 for ; Mon, 11 Jul 2011 07:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=subject:from:to:cc:content-type:date:message-id:mime-version :x-mailer:content-transfer-encoding; bh=UeI6rjzMHdPMjbutNVBECwf4YGJBItU5U1v76T32uqg=; b=dGy9UQY9B22H5IjG4bKtppJ95FGcGnn4e7NYyHqHzRDEwddnYkk6iAdW7pVkfz/cKc kSyAbzum642/mCXTLr9/X3xoNw1ZcdaHCxyVkq7cyod4v+w6INZH6oYq2T/zPenfGMXX KMgo5+vqVSxROX1tfSu1XeciJgYAKvl2tY4hE= Received: by 10.52.91.130 with SMTP id ce2mr2359687vdb.447.1310395302174; Mon, 11 Jul 2011 07:41:42 -0700 (PDT) Received: from [218.172.225.204] (218-172-225-204.dynamic.hinet.net [218.172.225.204]) by mx.google.com with ESMTPS id n2sm1735073vcb.37.2011.07.11.07.41.39 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 07:41:41 -0700 (PDT) Subject: [PATCH] Input: synaptics - make dmi_check_system return immediately when a match is found From: Axel Lin To: linux-kernel@vger.kernel.org Cc: Alessandro Rubini , Dmitry Torokhov , linux-input@vger.kernel.org Date: Mon, 11 Jul 2011 22:41:36 +0800 Message-ID: <1310395296.2415.7.camel@phoenix> Mime-Version: 1.0 X-Mailer: Evolution 2.32.2 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 11 Jul 2011 14:41:44 +0000 (UTC) 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 --- 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 { }