platform/x86: asus-wmi: Fix preserving keyboard backlight intensity on load
authorYurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
Tue, 14 May 2019 18:51:25 +0000 (20:51 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 17 Jun 2019 12:22:47 +0000 (15:22 +0300)
commit8853a2f6498b244d0cfff5c11158e2f76e323975
tree31150fc6af932da63a7f1b697a5dcc54e96231d6
parentcd10ee006ab504b2b9c5ed992cc06d3e110c6311
platform/x86: asus-wmi: Fix preserving keyboard backlight intensity on load

The error code and return value are mixed up. The intensity is always set
to 0 on load as kbd_led_read returns either 0 or negative value. To
reproduce set backlight to maximum, reload driver and try to increase it
using keyboard hotkey, the intensity will drop as a result. Correct the
implementation.

Signed-off-by: Yurii Pavlovskyi <yurii.pavlovskyi@gmail.com>
Reviewed-by: Daniel Drake <drake@endlessm.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/asus-wmi.c