diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-03-05 19:41:44 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2021-03-08 19:10:30 +0100 |
commit | 4c324548f09fec413b4ee589174dabacfe17d953 (patch) | |
tree | 43db312324b6fccc184402a163c06debbec484a9 /drivers/acpi/utils.c | |
parent | a030fee8db446aaf928c9c0960a21e319886ffdc (diff) | |
download | linux-4c324548f09fec413b4ee589174dabacfe17d953.tar.gz linux-4c324548f09fec413b4ee589174dabacfe17d953.tar.bz2 linux-4c324548f09fec413b4ee589174dabacfe17d953.zip |
ACPI: utils: Introduce acpi_evaluation_failure_warn()
Quite a few users of ACPI objects want to log a warning message if
the evaluation fails which is a repeating pattern, so introduce a
helper function for that purpose and convert some code where it is
open-coded to using it.
No intentional functional impact.
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 | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 682edd913b3b..f1aff4dab476 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c @@ -512,6 +512,20 @@ EXPORT_SYMBOL(__acpi_handle_debug); #endif /** + * acpi_evaluation_failure_warn - Log evaluation failure warning. + * @handle: Parent object handle. + * @name: Name of the object whose evaluation has failed. + * @status: Status value returned by the failing object evaluation. + */ +void acpi_evaluation_failure_warn(acpi_handle handle, const char *name, + acpi_status status) +{ + acpi_handle_warn(handle, "%s evaluation failed: %s\n", name, + acpi_format_exception(status)); +} +EXPORT_SYMBOL_GPL(acpi_evaluation_failure_warn); + +/** * acpi_has_method: Check whether @handle has a method named @name * @handle: ACPI device handle * @name: name of object or method |