diff mbox series

[2/2] SRU][OEM-5.10] platform/x86: thinkpad_acpi: correct palmsensor error checking

Message ID 20210116030019.630928-3-alex.hung@canonical.com
State New
Headers show
Series Thinkpad - add palm sensor support needed for WWAN | expand

Commit Message

Alex Hung Jan. 16, 2021, 3 a.m. UTC
From: Mark Pearson <markpearson@lenovo.com>

BugLink: https://bugs.launchpad.net/bugs/1912033

The previous commit adding functionality for the palm sensor had a
mistake which meant the error conditions on initialisation was not checked
correctly. On some older platforms this meant that if the sensor wasn't
available an error would be returned and the driver would fail to load.

This commit corrects the error condition. Many thanks to Mario Oenning
for reporting and determining the issue

Signed-off-by: Mark Pearson <markpearson@lenovo.com>
Link: https://lore.kernel.org/r/20201230024726.7861-1-markpearson@lenovo.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
(cherry picked from commit aa44afab87af079e0cf2ead9621d0447798a305e)
Signed-off-by: Alex Hung <alex.hung@canonical.com>
 drivers/platform/x86/thinkpad_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series


diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index 26b1502f9bbe..0a52edff7fd4 100644
--- a/drivers/platform/x86/thinkpad_acpi.c
+++ b/drivers/platform/x86/thinkpad_acpi.c
@@ -9951,9 +9951,9 @@  static int tpacpi_proxsensor_init(struct ibm_init_struct *iibm)
 	if ((palm_err == -ENODEV) && (lap_err == -ENODEV))
 		return 0;
 	/* Otherwise, if there was an error return it */
-	if (palm_err && (palm_err != ENODEV))
+	if (palm_err && (palm_err != -ENODEV))
 		return palm_err;
-	if (lap_err && (lap_err != ENODEV))
+	if (lap_err && (lap_err != -ENODEV))
 		return lap_err;
 	if (has_palmsensor) {