aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2010-07-20 18:19:40 -0400
committerMatthew Garrett <mjg@redhat.com>2010-08-03 09:48:57 -0400
commit80183a4b637982d56965e4a27b823c9a29d185b3 (patch)
treec8d248fb260fbd251030eeb90fbb9c280c36c0c2 /drivers/platform
parent9be0fcb5ed46509f859542fb2871ac2d277b5407 (diff)
compal-laptop/fujitsu-laptop/msi-laptop: make dmi_check_cb to return 1 instead of 0
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@gmail.com> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au> Cc: Matthew Garrett <mjg@redhat.com>a Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/compal-laptop.c2
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c6
-rw-r--r--drivers/platform/x86/msi-laptop.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 0dbc0bb21483..d071ce056322 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -275,7 +275,7 @@ static int set_backlight_level(int level)
275 275
276 ec_write(BACKLIGHT_LEVEL_ADDR, level); 276 ec_write(BACKLIGHT_LEVEL_ADDR, level);
277 277
278 return 0; 278 return 1;
279} 279}
280 280
281static int get_backlight_level(void) 281static int get_backlight_level(void)
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 4346d2652239..daf95f17886b 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)
603 dmi_check_cb_common(id); 603 dmi_check_cb_common(id);
604 fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */ 604 fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
605 fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */ 605 fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
606 return 0; 606 return 1;
607} 607}
608 608
609static int dmi_check_cb_s6420(const struct dmi_system_id *id) 609static 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)
611 dmi_check_cb_common(id); 611 dmi_check_cb_common(id);
612 fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */ 612 fujitsu->keycode1 = KEY_SCREENLOCK; /* "Lock" */
613 fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */ 613 fujitsu->keycode2 = KEY_HELP; /* "Mobility Center" */
614 return 0; 614 return 1;
615} 615}
616 616
617static int dmi_check_cb_p8010(const struct dmi_system_id *id) 617static 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)
620 fujitsu->keycode1 = KEY_HELP; /* "Support" */ 620 fujitsu->keycode1 = KEY_HELP; /* "Support" */
621 fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */ 621 fujitsu->keycode3 = KEY_SWITCHVIDEOMODE; /* "Presentation" */
622 fujitsu->keycode4 = KEY_WWW; /* "Internet" */ 622 fujitsu->keycode4 = KEY_WWW; /* "Internet" */
623 return 0; 623 return 1;
624} 624}
625 625
626static struct dmi_system_id fujitsu_dmi_table[] = { 626static struct dmi_system_id fujitsu_dmi_table[] = {
diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index afd762b58ad9..c67a74c46662 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)
434{ 434{
435 printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n", 435 printk(KERN_INFO "msi-laptop: Identified laptop model '%s'.\n",
436 id->ident); 436 id->ident);
437 return 0; 437 return 1;
438} 438}
439 439
440static struct dmi_system_id __initdata msi_dmi_table[] = { 440static struct dmi_system_id __initdata msi_dmi_table[] = {