aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Thébault <damien@dtbo.net>2018-07-18 06:06:01 -0400
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2018-07-31 10:40:36 -0400
commit5788f77959110480486c441b912da5c2cc5fc4d2 (patch)
tree0820284b547a1f57f4a22bb72b0d62cd5ba74e61
parentc2e2a618eb7104e18fdcf739d4d911563812a81c (diff)
platform/x86: dell-laptop: Fix backlight detection
Fix return code check for "max brightness" ACPI call. The Dell laptop ACPI video brightness control is not present on dell laptops anymore, but was present in older kernel versions. The code that checks the return value is incorrect since the SMM refactoring. The old code was: if (buffer->output[0] == 0) Which was changed to: ret = dell_send_request(...) if (ret) However, dell_send_request() will return 0 if buffer->output[0] == 0, so we must change the check to: if (ret == 0) This issue was found on a Dell M4800 laptop, and the fix tested on it as well. Fixes: 549b4930f057 ("dell-smbios: Introduce dispatcher for SMM calls") Signed-off-by: Damien Thébault <damien@dtbo.net> Tested-by: Damien Thébault <damien@dtbo.net> Reviewed-by: Pali Rohár <pali.rohar@gmail.com> Reviewed-by: Mario Limonciello <mario.limonciello@dell.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
-rw-r--r--drivers/platform/x86/dell-laptop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/platform/x86/dell-laptop.c b/drivers/platform/x86/dell-laptop.c
index f1fa8612db40..06978c14c83b 100644
--- a/drivers/platform/x86/dell-laptop.c
+++ b/drivers/platform/x86/dell-laptop.c
@@ -2185,7 +2185,7 @@ static int __init dell_init(void)
2185 dell_fill_request(&buffer, token->location, 0, 0, 0); 2185 dell_fill_request(&buffer, token->location, 0, 0, 0);
2186 ret = dell_send_request(&buffer, 2186 ret = dell_send_request(&buffer,
2187 CLASS_TOKEN_READ, SELECT_TOKEN_AC); 2187 CLASS_TOKEN_READ, SELECT_TOKEN_AC);
2188 if (ret) 2188 if (ret == 0)
2189 max_intensity = buffer.output[3]; 2189 max_intensity = buffer.output[3];
2190 } 2190 }
2191 2191