Commit 55455449 authored by Azael Avalos's avatar Azael Avalos Committed by Darren Hart

platform/x86: toshiba_haps: Split ACPI and HDD protection error handling

Currently the code checking for the ACPI status is mixed along with
the actual HDD protection status check.

This patch splits those two checks as they are not related, printing
an error string in case the ACPI call failed, and then check for
actual HDD protection status.
Signed-off-by: default avatarAzael Avalos <coproscefalo@gmail.com>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
parent 6f7e357b
...@@ -168,9 +168,13 @@ static int toshiba_haps_available(acpi_handle handle) ...@@ -168,9 +168,13 @@ static int toshiba_haps_available(acpi_handle handle)
* A non existent device as well as having (only) * A non existent device as well as having (only)
* Solid State Drives can cause the call to fail. * Solid State Drives can cause the call to fail.
*/ */
status = acpi_evaluate_integer(handle, "_STA", NULL, status = acpi_evaluate_integer(handle, "_STA", NULL, &hdd_present);
&hdd_present); if (ACPI_FAILURE(status)) {
if (ACPI_FAILURE(status) || !hdd_present) { pr_err("ACPI call to query HDD protection failed\n");
return 0;
}
if (!hdd_present) {
pr_info("HDD protection not available or using SSD\n"); pr_info("HDD protection not available or using SSD\n");
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment