MLK-17107-02: hdmi: Add api function return check
authorSandor Yu <Sandor.yu@nxp.com>
Mon, 11 Dec 2017 08:32:29 +0000 (16:32 +0800)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Add api function return check to hdmi api call.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
(cherry picked from commit cba6f4fc6f382731fabf938fb9e03db1c17b1666)

Conflicts:
drivers/gpu/drm/imx/hdp/imx-hdmi.c

drivers/gpu/drm/imx/hdp/imx-hdmi.c

index ecba30c..28b15ba 100644 (file)
@@ -101,17 +101,29 @@ void hdmi_mode_set(state_struct *state, int vic, int format, int color_depth, in
                ptype = 2;
 
        ret = CDN_API_HDMITX_Init_blocking(state);
-       pr_info("CDN_API_STATUS CDN_API_HDMITX_Init_blocking  ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_STATUS CDN_API_HDMITX_Init_blocking  ret = %d\n", ret);
+               return;
+       }
 
        /* Set HDMI TX Mode */
        ret = CDN_API_HDMITX_Set_Mode_blocking(state, ptype, character_freq_khz);
-       pr_info("CDN_API_HDMITX_Set_Mode_blocking ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_HDMITX_Set_Mode_blocking ret = %d\n", ret);
+               return;
+       }
 
        ret = CDN_API_Set_AVI(state, vic, format, bw_type);
-       pr_info("CDN_API_Set_AVI  ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_Set_AVI  ret = %d\n", ret);
+               return;
+       }
 
        ret =  CDN_API_HDMITX_SetVic_blocking(state, vic, color_depth, format);
-       pr_info("CDN_API_HDMITX_SetVic_blocking ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_HDMITX_SetVic_blocking ret = %d\n", ret);
+               return;
+       }
 
        msleep(50);
 }
@@ -178,17 +190,29 @@ void hdmi_mode_set_t28hpc(state_struct *state, int vic, int format, int color_de
                ptype = 2;
 
        ret = CDN_API_HDMITX_Init_blocking(state);
-       pr_info("CDN_API_STATUS CDN_API_HDMITX_Init_blocking  ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_STATUS CDN_API_HDMITX_Init_blocking  ret = %d\n", ret);
+               return;
+       }
 
        /* Set HDMI TX Mode */
        ret = CDN_API_HDMITX_Set_Mode_blocking(state, ptype, character_freq_khz);
-       pr_info("CDN_API_HDMITX_Set_Mode_blocking ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_HDMITX_Set_Mode_blocking ret = %d\n", ret);
+               return;
+       }
 
        ret = CDN_API_Set_AVI(state, vic, format, bw_type);
-       pr_info("CDN_API_Set_AVI  ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_Set_AVI  ret = %d\n", ret);
+               return;
+       }
 
        ret = CDN_API_HDMITX_SetVic_blocking(state, vic, color_depth, format);
-       pr_info("CDN_API_HDMITX_SetVic_blocking ret = %d\n", ret);
+       if (ret != CDN_OK) {
+               pr_info("CDN_API_HDMITX_SetVic_blocking ret = %d\n", ret);
+               return;
+       }
 
        msleep(200);
 }