diff -drupN a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c --- a/drivers/leds/leds-gpio.c 2018-08-06 17:23:04.000000000 +0300 +++ b/drivers/leds/leds-gpio.c 2022-06-12 05:28:14.000000000 +0300 @@ -42,9 +42,9 @@ static void gpio_led_set(struct led_clas int level; if (value == LED_OFF) - level = 0; - else level = 1; + else + level = 0; if (led_dat->blinking) { led_dat->platform_gpio_blink_set(led_dat->gpiod, level, @@ -135,7 +135,7 @@ static int create_gpio_led(const struct if (template->panic_indicator) led_dat->cdev.flags |= LED_PANIC_INDICATOR; - ret = gpiod_direction_output(led_dat->gpiod, state); + ret = gpiod_direction_output(led_dat->gpiod, !state); if (ret < 0) return ret;