lkml.org 
[lkml]   [2019]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH v3 02/11] platform/x86: asus-wmi: Fix preserving keyboard backlight intensity on load
    From
    Date
    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>
    ---
    drivers/platform/x86/asus-wmi.c | 3 +--
    1 file changed, 1 insertion(+), 2 deletions(-)

    diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
    index d865eb95054c..731ffd382426 100644
    --- a/drivers/platform/x86/asus-wmi.c
    +++ b/drivers/platform/x86/asus-wmi.c
    @@ -590,8 +590,7 @@ static int asus_wmi_led_init(struct asus_wmi *asus)
    goto error;
    }

    - led_val = kbd_led_read(asus, NULL, NULL);
    - if (led_val >= 0) {
    + if (!kbd_led_read(asus, &led_val, NULL)) {
    asus->kbd_led_wk = led_val;
    asus->kbd_led.name = "asus::kbd_backlight";
    asus->kbd_led.flags = LED_BRIGHT_HW_CHANGED;
    --
    2.17.1
    \
     
     \ /
      Last update: 2019-04-19 21:07    [W:2.215 / U:0.180 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site