Skip to content

Commit 6fc41c1

Browse files
JarmouniAnashif
authored andcommitted
drivers: display: stm32_ltdc: fix return value
Blanking On/Off calls should not return 0 when there is no panel controller to forward them to, instead they should return ENOSYS to signal to the application that they were not actually executed. "device_is_ready" does check for null, but also for "dev->state->initialized == false", so we need to isolate the "dev == NULL" case. Signed-off-by: Abderrahmane Jarmouni <[email protected]> (cherry picked from commit f7de44d)
1 parent b258fb0 commit 6fc41c1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/display/display_stm32_ltdc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,10 @@ static int stm32_ltdc_display_blanking_off(const struct device *dev)
252252
const struct display_stm32_ltdc_config *config = dev->config;
253253
const struct device *display_dev = config->display_controller;
254254

255+
/* Panel controller's phandle is not passed to LTDC in devicetree */
255256
if (display_dev == NULL) {
256-
return 0;
257+
LOG_ERR("There is no panel controller to forward blanking_off call to");
258+
return -ENOSYS;
257259
}
258260

259261
if (!device_is_ready(display_dev)) {
@@ -269,8 +271,10 @@ static int stm32_ltdc_display_blanking_on(const struct device *dev)
269271
const struct display_stm32_ltdc_config *config = dev->config;
270272
const struct device *display_dev = config->display_controller;
271273

274+
/* Panel controller's phandle is not passed to LTDC in devicetree */
272275
if (display_dev == NULL) {
273-
return 0;
276+
LOG_ERR("There is no panel controller to forward blanking_on call to");
277+
return -ENOSYS;
274278
}
275279

276280
if (!device_is_ready(config->display_controller)) {

0 commit comments

Comments
 (0)