Skip to contentSkip to conversation

toshiba_haps: Small updates to driver code

PATCH Applied Azael Avalos 2 participants 6 messages Sep 7, 2016 – Sep 23, 2016

Subsystems (3)
lore
Share & tools
lore
author maintainer
#1 lore raw

PATCH 1/2 toshiba_haps: Split ACPI status error check from HDD protection support

In reply to Azael Avalos

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

This patch splits those two checks are they are not related, printing an error string in case the ACPI call failed, and then check for actual HDD protection status.

---
 drivers/platform/x86/toshiba_haps.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/platform/x86/toshiba_haps.c +7 -3
index 7f2afc6..094f3a8 100644
@@ -168,9 +168,13 @@ static int toshiba_haps_available(acpi_handle handle)
 	 * A non existent device as well as having (only)
 	 * Solid State Drives can cause the call to fail.
 	 */
-	status = acpi_evaluate_integer(handle, "_STA", NULL,
-				       &hdd_present);
-	if (ACPI_FAILURE(status) || !hdd_present) {
+	status = acpi_evaluate_integer(handle, "_STA", NULL, &hdd_present);
+	if (ACPI_FAILURE(status)) {
+		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");
 		return 0;
 	}
Signature · 1 line
2.9.3
author maintainer
#2 lore raw

PATCH 2/2 toshiba_haps: Change the error logging level from info to debug

In reply to Azael Avalos

Two of the internal functions are printing an info message, one whenever the HDD protection level changes, and another when the driver receives an ACPI event.

This patch changes those two prints to debug, as that information is more pertaining to debuging purposes.

---
 drivers/platform/x86/toshiba_haps.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/toshiba_haps.c +2 -2
index 094f3a8..b3dec52 100644
@@ -59,7 +59,7 @@ static int toshiba_haps_protection_level(acpi_handle handle, int level)
 		return -EIO;
 	}
 
-	pr_info("HDD protection level set to: %d\n", level);
+	pr_debug("HDD protection level set to: %d\n", level);
 
 	return 0;
 }
@@ -141,7 +141,7 @@ static struct attribute_group haps_attr_group = {
  */
 static void toshiba_haps_notify(struct acpi_device *device, u32 event)
 {
-	pr_info("Received event: 0x%x", event);
+	pr_debug("Received event: 0x%x", event);
 
 	acpi_bus_generate_netlink_event(device->pnp.device_class,
 					dev_name(&device->dev),
Signature · 1 line
2.9.3
author maintainer
#3 lore raw

PATCH 1/1 toshiba_bluetooth: Decouple an error checking status code

In reply to Azael Avalos

This patch simply decouples te error checking of the ACPI status and the actual BT status, as those two were nested in an if/else check, but are completely unrelated.

---
 drivers/platform/x86/toshiba_bluetooth.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/platform/x86/toshiba_bluetooth.c +3 -1
index 5db495dd..be1d137 100644
@@ -80,7 +80,9 @@ static int toshiba_bluetooth_present(acpi_handle handle)
 	if (ACPI_FAILURE(result)) {
 		pr_err("ACPI call to query Bluetooth presence failed\n");
 		return -ENXIO;
-	} else if (!bt_present) {
+	}
+
+	if (!bt_present) {
 		pr_info("Bluetooth device not present\n");
 		return -ENODEV;
 	}
Signature · 1 line
2.9.3

Azael Avalos

author maintainer
#0 lore raw

cover toshiba_haps: Small updates to driver code

These two patches make some small changes to the driver code, the first splits the error check fro the ACPI status and the HDD protection, and the second simply changes the printing level of two strings from info to debug.

Azael Avalos (2):
toshiba_haps: Split ACPI status error check from HDD protection
support
toshiba_haps: Change the error logging level from info to debug

 drivers/platform/x86/toshiba_haps.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.9.3
Applied
#5 lore raw
Quoted 4 lines · Azael Avalos

These two patches make some small changes to the driver code, the first splits the error check fro the ACPI status and the HDD protection, and the second simply changes the printing level of two strings from info to debug.

Queued, thanks Azael.

After reviewing the history of this tree and following the approach of the ACPI tree, I've started prefixing commit subjects with "platform/x86: DRIVERNAME:
MESSAGE". Please use this format in the future (not a big deal, but it's nice when your subject is the same as the one I submit).

Thanks (and sorry for the delay).

Quoted 13 lines

Azael Avalos (2):
toshiba_haps: Split ACPI status error check from HDD protection
support
toshiba_haps: Change the error logging level from info to debug

 drivers/platform/x86/toshiba_haps.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
Signature · 1 line
2.9.3
Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
Applied
#4 lore raw

Re: [PATCH] toshiba_bluetooth: Decouple an error checking status code

In reply to Azael Avalos
Quoted 5 lines · Azael Avalos

This patch simply decouples te error checking of the ACPI status and the actual BT status, as those two were nested in an if/else check, but are completely unrelated.

Queued, thanks.

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center