Skip to content

Commit

Permalink
display: stm32: fix bug where missing backlight pin causes crash
Browse files Browse the repository at this point in the history
When backlight pin is not defined, a display suspend will cause
a crash since it looks at the wrong pin when deciding if
it exists.

Signed-off-by: Emil Lindqvist <[email protected]>
  • Loading branch information
emillindq committed Oct 10, 2023
1 parent fc078f9 commit d673f11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/display/display_stm32_ltdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ static int stm32_ltdc_suspend(const struct device *dev)
}

/* Turn off backlight (if its GPIO is defined in device tree) */
if (config->disp_on_gpio.port) {
if (config->bl_ctrl_gpio.port) {
err = gpio_pin_set_dt(&config->bl_ctrl_gpio, 0);
if (err < 0) {
return err;
Expand Down

0 comments on commit d673f11

Please sign in to comment.