aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2013-09-02 20:32:03 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:37:55 -0400
commitdd13b9a6d58d15a2cc596e1eb0baa043705c7bc8 (patch)
treed48991e456d0c0683cb747409637b7b36a0555e7 /drivers/platform
parentbe07c00e1639e6aa098d8ac5ea4d5ac58c3dbc50 (diff)
fujitsu-laptop: convert acpi_get_handle() to acpi_has_method()
acpi_has_method() is a new ACPI API introduced to check the existence of an ACPI control method. It can be used to replace acpi_get_handle() in the case that 1. the calling function doesn't need the ACPI handle of the control method. and 2. the calling function doesn't care the reason why the method is unavailable. Convert acpi_get_handle() to acpi_has_method() in drivers/platform/x86/fujitsu-laptop.c in this patch. Signed-off-by: Zhang Rui <rui.zhang@intel.com> CC: Matthew Garrett <matthew.garrett@nebula.com> Acked-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 29738cb2e3dd..765d8c15a0d9 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -579,11 +579,10 @@ static struct platform_driver fujitsupf_driver = {
579 579
580static void dmi_check_cb_common(const struct dmi_system_id *id) 580static void dmi_check_cb_common(const struct dmi_system_id *id)
581{ 581{
582 acpi_handle handle;
583 pr_info("Identified laptop model '%s'\n", id->ident); 582 pr_info("Identified laptop model '%s'\n", id->ident);
584 if (use_alt_lcd_levels == -1) { 583 if (use_alt_lcd_levels == -1) {
585 if (ACPI_SUCCESS(acpi_get_handle(NULL, 584 if (acpi_has_method(NULL,
586 "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle))) 585 "\\_SB.PCI0.LPCB.FJEX.SBL2"))
587 use_alt_lcd_levels = 1; 586 use_alt_lcd_levels = 1;
588 else 587 else
589 use_alt_lcd_levels = 0; 588 use_alt_lcd_levels = 0;
@@ -646,7 +645,6 @@ static struct dmi_system_id fujitsu_dmi_table[] = {
646 645
647static int acpi_fujitsu_add(struct acpi_device *device) 646static int acpi_fujitsu_add(struct acpi_device *device)
648{ 647{
649 acpi_handle handle;
650 int result = 0; 648 int result = 0;
651 int state = 0; 649 int state = 0;
652 struct input_dev *input; 650 struct input_dev *input;
@@ -695,8 +693,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
695 693
696 fujitsu->dev = device; 694 fujitsu->dev = device;
697 695
698 if (ACPI_SUCCESS 696 if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
699 (acpi_get_handle(device->handle, METHOD_NAME__INI, &handle))) {
700 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); 697 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
701 if (ACPI_FAILURE 698 if (ACPI_FAILURE
702 (acpi_evaluate_object 699 (acpi_evaluate_object
@@ -796,7 +793,6 @@ static void acpi_fujitsu_notify(struct acpi_device *device, u32 event)
796 793
797static int acpi_fujitsu_hotkey_add(struct acpi_device *device) 794static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
798{ 795{
799 acpi_handle handle;
800 int result = 0; 796 int result = 0;
801 int state = 0; 797 int state = 0;
802 struct input_dev *input; 798 struct input_dev *input;
@@ -859,8 +855,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
859 855
860 fujitsu_hotkey->dev = device; 856 fujitsu_hotkey->dev = device;
861 857
862 if (ACPI_SUCCESS 858 if (acpi_has_method(device->handle, METHOD_NAME__INI)) {
863 (acpi_get_handle(device->handle, METHOD_NAME__INI, &handle))) {
864 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n"); 859 vdbg_printk(FUJLAPTOP_DBG_INFO, "Invoking _INI\n");
865 if (ACPI_FAILURE 860 if (ACPI_FAILURE
866 (acpi_evaluate_object 861 (acpi_evaluate_object