MLK-19318 drm/imx: lcdif: avoid log print when no device attached
authorFancy Fang <chen.fang@nxp.com>
Fri, 31 Aug 2018 03:27:29 +0000 (11:27 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
In the 'lcdif_crtc_atomic_check()', when the 'bus_format' is
zero which means that there is no valid display peripherals
attached to LCDIF, return directly to avoid below error log
to make noises, since the error log is not cared in this case.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 25d2b80f637af06094f56c60d46404af3b7ff381)
(cherry picked from commit 535a7256a3eae059398acaa040f42a4aa650bbea)

drivers/gpu/drm/imx/lcdif/lcdif-crtc.c

index c9a617e..457483e 100644 (file)
@@ -94,6 +94,13 @@ static int lcdif_crtc_atomic_check(struct drm_crtc *crtc,
        struct lcdif_crtc *lcdif_crtc = to_lcdif_crtc(crtc);
        struct imx_crtc_state *imx_crtc_state = to_imx_crtc_state(state);
 
+       /* return directly when no devices attached
+        * to LCDIF to avoid below error messsage to
+        * make noises in this case.
+        */
+       if (!imx_crtc_state->bus_format)
+               return -EINVAL;
+
        /* check the requested bus format can be
         * supported by LCDIF CTRC or not
         */