Skip to content

Commit

Permalink
platform/x86: dell-laptop: Fix backlight detection
Browse files Browse the repository at this point in the history
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: 549b493 ("dell-smbios: Introduce dispatcher for SMM calls")
Signed-off-by: Damien Thébault <[email protected]>
Tested-by: Damien Thébault <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Reviewed-by: Mario Limonciello <[email protected]>
Signed-off-by: Andy Shevchenko <[email protected]>
  • Loading branch information
Damien Thébault authored and andy-shev committed Jul 20, 2018
1 parent 9d3cce1 commit 2502e5a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/platform/x86/dell-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,7 @@ static int __init dell_init(void)
dell_fill_request(&buffer, token->location, 0, 0, 0);
ret = dell_send_request(&buffer,
CLASS_TOKEN_READ, SELECT_TOKEN_AC);
if (ret)
if (ret == 0)
max_intensity = buffer.output[3];
}

Expand Down

0 comments on commit 2502e5a

Please sign in to comment.