diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-26 19:25:28 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-26 19:25:28 -0400 |
commit | c92f56cbdfc08c8c207c9476c69c99fdbadbd77b (patch) | |
tree | c38480e47fc7c85ea609a6f882f5c5143c33cb74 /drivers/acpi/video_detect.c | |
parent | d8dfad3876e4386666b759da3c833d62fb8b2267 (diff) | |
parent | 0177f29fea534ef5e6af2d76e9a9be0fdd325c4d (diff) |
Merge branch 'acpi-cleanup'
* acpi-cleanup: (21 commits)
ACPI / dock: fix error return code in dock_add()
ACPI / dock: Drop unnecessary local variable from dock_add()
ACPI / dock / PCI: Drop ACPI dock notifier chain
ACPI / dock: Do not check CONFIG_ACPI_DOCK_MODULE
ACPI / dock: Do not leak memory on falilures to add a dock station
ACPI: Drop ACPI bus notifier call chain
ACPI / dock: Rework the handling of notifications
ACPI / dock: Simplify dock_init_hotplug() and dock_release_hotplug()
ACPI / dock: Walk list in reverse order during removal of devices
ACPI / dock: Rework and simplify find_dock_devices()
ACPI / dock: Drop the hp_lock mutex from struct dock_station
ACPI: simplify acpiphp driver with new helper functions
ACPI: simplify dock driver with new helper functions
ACPI: Export acpi_(bay)|(dock)_match() from scan.c
ACPI: introduce two helper functions for _EJ0 and _LCK
ACPI: introduce helper function acpi_execute_simple_method()
ACPI: introduce helper function acpi_has_method()
ACPI / dock: simplify dock_create_acpi_device()
ACPI / dock: mark initialization functions with __init
ACPI / dock: drop redundant spin lock in dock station object
...
Diffstat (limited to 'drivers/acpi/video_detect.c')
-rw-r--r-- | drivers/acpi/video_detect.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index c3397748ba46..940edbf2fe8f 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -53,14 +53,13 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, | |||
53 | void **retyurn_value) | 53 | void **retyurn_value) |
54 | { | 54 | { |
55 | long *cap = context; | 55 | long *cap = context; |
56 | acpi_handle h_dummy; | ||
57 | 56 | ||
58 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_BCM", &h_dummy)) && | 57 | if (acpi_has_method(handle, "_BCM") && |
59 | ACPI_SUCCESS(acpi_get_handle(handle, "_BCL", &h_dummy))) { | 58 | acpi_has_method(handle, "_BCL")) { |
60 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight " | 59 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found generic backlight " |
61 | "support\n")); | 60 | "support\n")); |
62 | *cap |= ACPI_VIDEO_BACKLIGHT; | 61 | *cap |= ACPI_VIDEO_BACKLIGHT; |
63 | if (ACPI_FAILURE(acpi_get_handle(handle, "_BQC", &h_dummy))) | 62 | if (!acpi_has_method(handle, "_BQC")) |
64 | printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " | 63 | printk(KERN_WARNING FW_BUG PREFIX "No _BQC method, " |
65 | "cannot determine initial brightness\n"); | 64 | "cannot determine initial brightness\n"); |
66 | /* We have backlight support, no need to scan further */ | 65 | /* We have backlight support, no need to scan further */ |
@@ -79,22 +78,20 @@ acpi_backlight_cap_match(acpi_handle handle, u32 level, void *context, | |||
79 | */ | 78 | */ |
80 | long acpi_is_video_device(acpi_handle handle) | 79 | long acpi_is_video_device(acpi_handle handle) |
81 | { | 80 | { |
82 | acpi_handle h_dummy; | ||
83 | long video_caps = 0; | 81 | long video_caps = 0; |
84 | 82 | ||
85 | /* Is this device able to support video switching ? */ | 83 | /* Is this device able to support video switching ? */ |
86 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_DOD", &h_dummy)) || | 84 | if (acpi_has_method(handle, "_DOD") || acpi_has_method(handle, "_DOS")) |
87 | ACPI_SUCCESS(acpi_get_handle(handle, "_DOS", &h_dummy))) | ||
88 | video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; | 85 | video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; |
89 | 86 | ||
90 | /* Is this device able to retrieve a video ROM ? */ | 87 | /* Is this device able to retrieve a video ROM ? */ |
91 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_ROM", &h_dummy))) | 88 | if (acpi_has_method(handle, "_ROM")) |
92 | video_caps |= ACPI_VIDEO_ROM_AVAILABLE; | 89 | video_caps |= ACPI_VIDEO_ROM_AVAILABLE; |
93 | 90 | ||
94 | /* Is this device able to configure which video head to be POSTed ? */ | 91 | /* Is this device able to configure which video head to be POSTed ? */ |
95 | if (ACPI_SUCCESS(acpi_get_handle(handle, "_VPO", &h_dummy)) && | 92 | if (acpi_has_method(handle, "_VPO") && |
96 | ACPI_SUCCESS(acpi_get_handle(handle, "_GPD", &h_dummy)) && | 93 | acpi_has_method(handle, "_GPD") && |
97 | ACPI_SUCCESS(acpi_get_handle(handle, "_SPD", &h_dummy))) | 94 | acpi_has_method(handle, "_SPD")) |
98 | video_caps |= ACPI_VIDEO_DEVICE_POSTING; | 95 | video_caps |= ACPI_VIDEO_DEVICE_POSTING; |
99 | 96 | ||
100 | /* Only check for backlight functionality if one of the above hit. */ | 97 | /* Only check for backlight functionality if one of the above hit. */ |