Skip to content

Commit

Permalink
platform/x86: thinkpad_acpi: correct palmsensor error checking
Browse files Browse the repository at this point in the history
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 aa44afa)
Signed-off-by: Alex Hung <alex.hung@canonical.com>
Signed-off-by: Timo Aaltonen <timo.aaltonen@canonical.com>
  • Loading branch information
Mark Pearson authored and Timo Aaltonen committed Feb 3, 2021
1 parent 8fd7b3c commit c834125
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit c834125

Please sign in to comment.