--- zzzz-none-000/linux-3.10.107/drivers/leds/trigger/ledtrig-backlight.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/leds/trigger/ledtrig-backlight.c 2021-02-04 17:41:59.000000000 +0000 @@ -36,26 +36,28 @@ struct bl_trig_notifier, notifier); struct led_classdev *led = n->led; struct fb_event *fb_event = data; - int *blank = fb_event->data; - int new_status = *blank ? BLANK : UNBLANK; + int *blank; + int new_status; - switch (event) { - case FB_EVENT_BLANK: - if (new_status == n->old_status) - break; - - if ((n->old_status == UNBLANK) ^ n->invert) { - n->brightness = led->brightness; - __led_set_brightness(led, LED_OFF); - } else { - __led_set_brightness(led, n->brightness); - } - - n->old_status = new_status; - - break; + /* If we aren't interested in this event, skip it immediately ... */ + if (event != FB_EVENT_BLANK) + return 0; + + blank = fb_event->data; + new_status = *blank ? BLANK : UNBLANK; + + if (new_status == n->old_status) + return 0; + + if ((n->old_status == UNBLANK) ^ n->invert) { + n->brightness = led->brightness; + led_set_brightness_async(led, LED_OFF); + } else { + led_set_brightness_async(led, n->brightness); } + n->old_status = new_status; + return 0; } @@ -87,9 +89,9 @@ /* After inverting, we need to update the LED. */ if ((n->old_status == BLANK) ^ n->invert) - __led_set_brightness(led, LED_OFF); + led_set_brightness_async(led, LED_OFF); else - __led_set_brightness(led, n->brightness); + led_set_brightness_async(led, n->brightness); return num; }