aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/video-uclass.c
diff options
context:
space:
mode:
authorAnatolij Gustschin2019-12-04 16:18:39 +0100
committerAnatolij Gustschin2019-12-06 16:37:45 +0100
commitca5655d8006cfbaa4ff8ff450e4a5931e57fe050 (patch)
tree81d782c87b7fba2052b9e300c62cf0f34070c17c /drivers/video/video-uclass.c
parentca2c6945b9e158716138b9d138c72676e719bd8e (diff)
video: add guards around 16bpp/32bbp code
Many boards use only single depth configuration, for such boards there is some unused code in video and console uclass routines. Add guards to avoid dead code. Signed-off-by: Anatolij Gustschin <agust@denx.de> Tested-by: Eugen Hristev <eugen.hristev@microchip.com> Tested-by: Patrice Chotard <patrice.chotard@st.com> Tested-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Diffstat (limited to 'drivers/video/video-uclass.c')
-rw-r--r--drivers/video/video-uclass.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index f660c5205ed..5ea7568fa4c 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -92,6 +92,7 @@ int video_clear(struct udevice *dev)
struct video_priv *priv = dev_get_uclass_priv(dev);
switch (priv->bpix) {
+#ifdef CONFIG_VIDEO_BPP16
case VIDEO_BPP16: {
u16 *ppix = priv->fb;
u16 *end = priv->fb + priv->fb_size;
@@ -100,6 +101,8 @@ int video_clear(struct udevice *dev)
*ppix++ = priv->colour_bg;
break;
}
+#endif
+#ifdef CONFIG_VIDEO_BPP32
case VIDEO_BPP32: {
u32 *ppix = priv->fb;
u32 *end = priv->fb + priv->fb_size;
@@ -108,6 +111,7 @@ int video_clear(struct udevice *dev)
*ppix++ = priv->colour_bg;
break;
}
+#endif
default:
memset(priv->fb, priv->colour_bg, priv->fb_size);
break;