From ab6ea931deeb8e435aeeb251bac7a2433e016271 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Mon, 6 Jan 2020 23:00:38 +0100 Subject: video: fix Coverity missing break issue Fix: >>> CID 280902: Control flow issues (MISSING_BREAK) >>> The case for value "VIDEO_BPP32" is not terminated >>> by a 'break' statement. Also fix error: control reaches end of non-void function [-Werror=return-type] Reported-by: Tom Rini Signed-off-by: Anatolij Gustschin Reviewed-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 75c7e25095..8e0fc7f3ec 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -144,22 +144,26 @@ u32 vid_console_color(struct video_priv *priv, unsigned int idx) ((colors[idx].g >> 2) << 5) | ((colors[idx].b >> 3) << 0); } + break; case VIDEO_BPP32: if (CONFIG_IS_ENABLED(VIDEO_BPP32)) { return (colors[idx].r << 16) | (colors[idx].g << 8) | (colors[idx].b << 0); } + break; default: - /* - * For unknown bit arrangements just support - * black and white. - */ - if (idx) - return 0xffffff; /* white */ - else - return 0x000000; /* black */ + break; } + + /* + * For unknown bit arrangements just support + * black and white. + */ + if (idx) + return 0xffffff; /* white */ + + return 0x000000; /* black */ } static char *parsenum(char *s, int *num) -- cgit v1.2.1 From 8382b1019283d2c1e9ba09cf0a10205deaf32fe1 Mon Sep 17 00:00:00 2001 From: Anatolij Gustschin Date: Sat, 25 Jan 2020 23:44:56 +0100 Subject: video: mxsfb: call remove() when booting OS Add DM_FLAG_OS_PREPARE flag to ensure that the driver's remove() callback is invoked before booting the kernel. This is required to stop the LCDIF controller. This was the behaviour with old driver without DM_VIDEO support. Without stopping the LCDIF we sometimes observe incorrect Linux logo position. Fixes: ae0760584b38 ("imx: mx6ul_14x14_evk: convert to DM_VIDEO") Signed-off-by: Anatolij Gustschin Reported-by: Fabio Estevam Reviewed-by: Fabio Estevam --- drivers/video/mxsfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index c52981053e..c097682d00 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -429,6 +429,6 @@ U_BOOT_DRIVER(mxs_video) = { .bind = mxs_video_bind, .probe = mxs_video_probe, .remove = mxs_video_remove, - .flags = DM_FLAG_PRE_RELOC, + .flags = DM_FLAG_PRE_RELOC | DM_FLAG_OS_PREPARE, }; #endif /* ifndef CONFIG_DM_VIDEO */ -- cgit v1.2.1