diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2013-06-28 12:24:38 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-14 19:33:10 -0400 |
commit | 952c63e9512b63220886105cfc791507046fa39a (patch) | |
tree | bf3bd0592ea0fac74418fe16b8a4125e2db799ea /drivers/acpi/resource.c | |
parent | 472d963befe28b8614ea2789757b27536c8d79eb (diff) |
ACPI: introduce helper function acpi_has_method()
Introduce helper function acpi_has_method() and use it in a number
of places to simplify code.
[rjw: Changelog]
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/resource.c')
-rw-r--r-- | drivers/acpi/resource.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c index 3322b47ab7ca..b7201fc6f1e1 100644 --- a/drivers/acpi/resource.c +++ b/drivers/acpi/resource.c | |||
@@ -505,14 +505,12 @@ int acpi_dev_get_resources(struct acpi_device *adev, struct list_head *list, | |||
505 | void *preproc_data) | 505 | void *preproc_data) |
506 | { | 506 | { |
507 | struct res_proc_context c; | 507 | struct res_proc_context c; |
508 | acpi_handle not_used; | ||
509 | acpi_status status; | 508 | acpi_status status; |
510 | 509 | ||
511 | if (!adev || !adev->handle || !list_empty(list)) | 510 | if (!adev || !adev->handle || !list_empty(list)) |
512 | return -EINVAL; | 511 | return -EINVAL; |
513 | 512 | ||
514 | status = acpi_get_handle(adev->handle, METHOD_NAME__CRS, ¬_used); | 513 | if (!acpi_has_method(adev->handle, METHOD_NAME__CRS)) |
515 | if (ACPI_FAILURE(status)) | ||
516 | return 0; | 514 | return 0; |
517 | 515 | ||
518 | c.list = list; | 516 | c.list = list; |