diff options
author | Jiang Liu <jiang.liu@huawei.com> | 2013-06-28 18:24:38 +0200 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-07-15 01:33:10 +0200 |
commit | 952c63e9512b63220886105cfc791507046fa39a (patch) | |
tree | bf3bd0592ea0fac74418fe16b8a4125e2db799ea /drivers/acpi/utils.c | |
parent | ACPI / dock: simplify dock_create_acpi_device() (diff) | |
download | linux-952c63e9512b63220886105cfc791507046fa39a.tar.xz linux-952c63e9512b63220886105cfc791507046fa39a.zip |
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/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 744371304313..b08d97376f84 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -495,3 +495,18 @@ acpi_handle_printk(const char *level, acpi_handle handle, const char *fmt, ...) kfree(buffer.pointer); } EXPORT_SYMBOL(acpi_handle_printk); + +/** + * acpi_has_method: Check whether @handle has a method named @name + * @handle: ACPI device handle + * @name: name of object or method + * + * Check whether @handle has a method named @name. + */ +bool acpi_has_method(acpi_handle handle, char *name) +{ + acpi_handle tmp; + + return ACPI_SUCCESS(acpi_get_handle(handle, name, &tmp)); +} +EXPORT_SYMBOL(acpi_has_method); |