Commit 587eb87b authored by Damien Thébault's avatar Damien Thébault Committed by Greg Kroah-Hartman
Browse files

platform/x86: dell-laptop: Fix backlight detection



[ Upstream commit 2502e5a0 ]

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: 549b4930 ("dell-smbios: Introduce dispatcher for SMM calls")
Signed-off-by: default avatarDamien Thébault <damien@dtbo.net>
Tested-by: default avatarDamien Thébault <damien@dtbo.net>
Reviewed-by: default avatarPali Rohár <pali.rohar@gmail.com>
Reviewed-by: default avatarMario Limonciello <mario.limonciello@dell.com>
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 844c2af0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment