aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorAzael Avalos <coproscefalo@gmail.com>2016-09-07 11:28:13 -0400
committerDarren Hart <dvhart@linux.intel.com>2016-09-23 19:21:05 -0400
commit55455449982564da833d51b28bdd39a06ad28740 (patch)
tree42a2ee30bb0f989fba3f5cf1d1dc012d2ba6076b /drivers/platform
parent6f7e357bf181b5a9da9daffcd40a64ee516a29e4 (diff)
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: Azael Avalos <coproscefalo@gmail.com> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/toshiba_haps.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/platform/x86/toshiba_haps.c b/drivers/platform/x86/toshiba_haps.c
index 7f2afc6b5eb9..094f3a898d91 100644
--- a/drivers/platform/x86/toshiba_haps.c
+++ b/drivers/platform/x86/toshiba_haps.c
@@ -168,9 +168,13 @@ static int toshiba_haps_available(acpi_handle handle)
168 * A non existent device as well as having (only) 168 * A non existent device as well as having (only)
169 * Solid State Drives can cause the call to fail. 169 * Solid State Drives can cause the call to fail.
170 */ 170 */
171 status = acpi_evaluate_integer(handle, "_STA", NULL, 171 status = acpi_evaluate_integer(handle, "_STA", NULL, &hdd_present);
172 &hdd_present); 172 if (ACPI_FAILURE(status)) {
173 if (ACPI_FAILURE(status) || !hdd_present) { 173 pr_err("ACPI call to query HDD protection failed\n");
174 return 0;
175 }
176
177 if (!hdd_present) {
174 pr_info("HDD protection not available or using SSD\n"); 178 pr_info("HDD protection not available or using SSD\n");
175 return 0; 179 return 0;
176 } 180 }