diff options
author | Zhang Rui <rui.zhang@intel.com> | 2013-09-02 20:32:04 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-09-23 19:37:55 -0400 |
commit | 70122e3d3108d89d7d2dc0d8a11e7163a84d9d40 (patch) | |
tree | 3237deff188ee0d5af08f6640022d3878aef538e /drivers/platform | |
parent | dd13b9a6d58d15a2cc596e1eb0baa043705c7bc8 (diff) |
intel_menlow: 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/intel_menlow.c in this patch.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
CC: Matthew Garrett <matthew.garrett@nebula.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/intel_menlow.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/platform/x86/intel_menlow.c b/drivers/platform/x86/intel_menlow.c index d6cfc1558c2f..11244f8703c4 100644 --- a/drivers/platform/x86/intel_menlow.c +++ b/drivers/platform/x86/intel_menlow.c | |||
@@ -156,19 +156,15 @@ static struct thermal_cooling_device_ops memory_cooling_ops = { | |||
156 | static int intel_menlow_memory_add(struct acpi_device *device) | 156 | static int intel_menlow_memory_add(struct acpi_device *device) |
157 | { | 157 | { |
158 | int result = -ENODEV; | 158 | int result = -ENODEV; |
159 | acpi_status status = AE_OK; | ||
160 | acpi_handle dummy; | ||
161 | struct thermal_cooling_device *cdev; | 159 | struct thermal_cooling_device *cdev; |
162 | 160 | ||
163 | if (!device) | 161 | if (!device) |
164 | return -EINVAL; | 162 | return -EINVAL; |
165 | 163 | ||
166 | status = acpi_get_handle(device->handle, MEMORY_GET_BANDWIDTH, &dummy); | 164 | if (!acpi_has_method(device->handle, MEMORY_GET_BANDWIDTH)) |
167 | if (ACPI_FAILURE(status)) | ||
168 | goto end; | 165 | goto end; |
169 | 166 | ||
170 | status = acpi_get_handle(device->handle, MEMORY_SET_BANDWIDTH, &dummy); | 167 | if (!acpi_has_method(device->handle, MEMORY_SET_BANDWIDTH)) |
171 | if (ACPI_FAILURE(status)) | ||
172 | goto end; | 168 | goto end; |
173 | 169 | ||
174 | cdev = thermal_cooling_device_register("Memory controller", device, | 170 | cdev = thermal_cooling_device_register("Memory controller", device, |