aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2013-09-02 20:32:12 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-09-23 19:37:57 -0400
commit29c29a9bb4d5abdb92480375e42e48a9190306e8 (patch)
tree2ea2316461e22020a1c13112ffd1958112be1a1a /drivers/platform/x86
parent74da276028966f333acc97b59292f928c16c1709 (diff)
fujitsu-laptop: convert acpi_evaluate_object() to acpi_evaluate_integer()
acpi_evaluate_integer() is an ACPI API introduced to evaluate an ACPI control method that is known to have an integer return value. This API can simplify the code because the calling function does not need to use the specified acpi_buffer structure required by acpi_evaluate_object(); Convert acpi_evaluate_object() to acpi_evaluate_integer() 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/x86')
-rw-r--r--drivers/platform/x86/fujitsu-laptop.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 765d8c15a0d9..9d30d69aa78f 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -219,8 +219,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
219 { .type = ACPI_TYPE_INTEGER } 219 { .type = ACPI_TYPE_INTEGER }
220 }; 220 };
221 struct acpi_object_list arg_list = { 4, &params[0] }; 221 struct acpi_object_list arg_list = { 4, &params[0] };
222 struct acpi_buffer output; 222 unsigned long long value;
223 union acpi_object out_obj;
224 acpi_handle handle = NULL; 223 acpi_handle handle = NULL;
225 224
226 status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle); 225 status = acpi_get_handle(fujitsu_hotkey->acpi_handle, "FUNC", &handle);
@@ -235,10 +234,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
235 params[2].integer.value = arg1; 234 params[2].integer.value = arg1;
236 params[3].integer.value = arg2; 235 params[3].integer.value = arg2;
237 236
238 output.length = sizeof(out_obj); 237 status = acpi_evaluate_integer(handle, NULL, &arg_list, &value);
239 output.pointer = &out_obj;
240
241 status = acpi_evaluate_object(handle, NULL, &arg_list, &output);
242 if (ACPI_FAILURE(status)) { 238 if (ACPI_FAILURE(status)) {
243 vdbg_printk(FUJLAPTOP_DBG_WARN, 239 vdbg_printk(FUJLAPTOP_DBG_WARN,
244 "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n", 240 "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) call failed\n",
@@ -246,18 +242,10 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
246 return -ENODEV; 242 return -ENODEV;
247 } 243 }
248 244
249 if (out_obj.type != ACPI_TYPE_INTEGER) {
250 vdbg_printk(FUJLAPTOP_DBG_WARN,
251 "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) did not "
252 "return an integer\n",
253 cmd, arg0, arg1, arg2);
254 return -ENODEV;
255 }
256
257 vdbg_printk(FUJLAPTOP_DBG_TRACE, 245 vdbg_printk(FUJLAPTOP_DBG_TRACE,
258 "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n", 246 "FUNC 0x%x (args 0x%x, 0x%x, 0x%x) returned 0x%x\n",
259 cmd, arg0, arg1, arg2, (int)out_obj.integer.value); 247 cmd, arg0, arg1, arg2, (int)value);
260 return out_obj.integer.value; 248 return value;
261} 249}
262 250
263#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 251#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)