[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201007050712.o657CpjO028121@turbo.physics.adelaide.edu.au>
Date: Mon, 5 Jul 2010 16:42:51 +0930 (CST)
From: Jonathan Woithe <jwoithe@...sics.adelaide.edu.au>
To: axel.lin@...il.com (Axel Lin)
Cc: linux-kernel@...r.kernel.org (linux-kernel),
cezary.jackiewicz@...il.com (Cezary Jackiewicz),
mjg@...hat.com (Matthew Garrett),
tim.gardner@...onical.com (Tim Gardner),
Mario_Limonciello@...l.com (Mario Limonciello),
rpurdie@...ux.intel.com (Richard Purdie),
mmarek@...e.cz (Michal Marek),
jwoithe@...sics.adelaide.edu.au (Jonathan Woithe),
len.brown@...el.com (Len Brown),
akpm@...ux-foundation.org (Andrew Morton),
stefani@...bold.net (Stefani Seibold),
ak@...ux.intel.com (Andi Kleen),
mzxreary@...inter.de (Lennart Poettering),
jlee@...ell.com (Lee Chun-Yi),
platform-driver-x86@...r.kernel.org
Subject: Re: [PATCH] compal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb
Is there no possibility of some other matching function existing after ours
in the tree which might need to also be called? If so, this change would
prevent that.
Regards
jonathan
> dmi_check_system() walks the table running matching functions until someone
> returns non zero or we hit the end.
>
> This patch makes dmi_check_cb to return 1 so dmi_check_system() return
> immediately when a match is found.
>
> Signed-off-by: Axel Lin <axel.lin@...il.com>
> ---
> drivers/platform/x86/compal-laptop.c | 2 +-
> drivers/platform/x86/fujitsu-laptop.c | 6 +++---
> drivers/platform/x86/msi-laptop.c | 2 +-
> 3 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
> index 71ff154..dc31a08 100644
> --- a/drivers/platform/x86/compal-laptop.c
> +++ b/drivers/platform/x86/compal-laptop.c
> @@ -190,7 +190,7 @@ static int dmi_check_cb(const struct dmi_system_id *id)
> printk(KERN_INFO "compal-laptop: Identified laptop model '%s'.\n",
> id->ident);
>
> - return 0;
> + return 1;
> }
>
> static struct dmi_system_id __initdata compal_dmi_table[] = {
> diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> index dab1a0e..1859d7f 100644
> --- a/drivers/platform/x86/fujitsu-laptop.c
> +++ b/drivers/platform/x86/fujitsu-laptop.c
> @@ -603,7 +603,7 @@ static int dmi_check_cb_s6410(const struct dmi_system_id *id)
> dmi_check_cb_common(id);
> fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
> fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
> - return 0;
> + return 1;
> }
>
> static int dmi_check_cb_s6420(const struct dmi_system_id *id)
> @@ -611,7 +611,7 @@ static int dmi_check_cb_s6420(const struct dmi_system_id *id)
> dmi_check_cb_common(id);
> fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
> fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
> - return 0;
> + return 1;
> }
>
> static int dmi_check_cb_p8010(const struct dmi_system_id *id)
> @@ -620,7 +620,7 @@ static int dmi_check_cb_p8010(const struct dmi_system_id *id)
> fujitsu->keycode1 = KEY_HELP; /* "Support" */
> fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
> fujitsu->keycode4 = KEY_WWW; /* "Internet" */
> - return 0;
> + return 1;
> }
>
> static struct dmi_system_id fujitsu_dmi_table[] = {
> diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
> index afd762b..c67a74c 100644
> --- a/drivers/platform/x86/msi-laptop.c
> +++ b/drivers/platform/x86/msi-laptop.c
> @@ -434,7 +434,7 @@ static int dmi_check_cb(const struct dmi_system_id *id)
> {
> printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
> id->ident);
> - return 0;
> + return 1;
> }
>
> static struct dmi_system_id __initdata msi_dmi_table[] = {
> --
> 1.5.4.3
>
>
>
--
* Jonathan Woithe jwoithe@...sics.adelaide.edu.au *
* http://www.physics.adelaide.edu.au/~jwoithe *
***-----------------------------------------------------------------------***
** "Time is an illusion; lunchtime doubly so" **
* "...you wouldn't recognize a subtle plan if it painted itself purple and *
* danced naked on a harpsichord singing 'subtle plans are here again'" *
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists