X86 platform drivers
 help / color / mirror / Atom feed
* [PATCH] platform/x86: thinkpad_acpi: correct palmsensor error checking
@ 2020-12-30  2:47 Mark Pearson
  2021-01-04 14:56 ` Hans de Goede
  2021-01-04 15:17 ` Andy Shevchenko
  0 siblings, 2 replies; 5+ messages in thread
From: Mark Pearson @ 2020-12-30  2:47 UTC (permalink / raw)
  To: markpearson; +Cc: hdegoede, mgross, platform-driver-x86

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>
---
 drivers/platform/x86/thinkpad_acpi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c
index e03df2881dc6..c102657b3eb3 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) {
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-01-04 15:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-30  2:47 [PATCH] platform/x86: thinkpad_acpi: correct palmsensor error checking Mark Pearson
2021-01-04 14:56 ` Hans de Goede
2021-01-04 15:17 ` Andy Shevchenko
2021-01-04 15:32   ` Hans de Goede
2021-01-04 15:43     ` [External] " Mark Pearson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox