The function clk_set_rate() will return it's input parameter, so it's return
value in normal condition is nonzero. In this case, we should report error
when it return zero rather than return a nonzero value.

Signed-off-by: Eric Gao <eric....@rock-chips.com>
---

Changes in v4:
-Move this patch to an early stage.

Changes in v3:
-Improve indentation relationship

Changes in v2:
-Fix rk_display_init() function report error(err:-19).

 drivers/video/rockchip/rk_vop.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/video/rockchip/rk_vop.c b/drivers/video/rockchip/rk_vop.c
index bc02f80..0691fdf 100644
--- a/drivers/video/rockchip/rk_vop.c
+++ b/drivers/video/rockchip/rk_vop.c
@@ -242,11 +242,13 @@ int rk_display_init(struct udevice *dev, ulong fbbase,
        }
 
        ret = clk_get_by_index(dev, 1, &clk);
-       if (!ret)
+       if (!ret) {
                ret = clk_set_rate(&clk, timing.pixelclock.typ);
-       if (ret) {
-               debug("%s: Failed to set pixel clock: ret=%d\n", __func__, ret);
-               return ret;
+               if (!ret) {
+                       debug("%s: Failed to set pixel clock: ret=%d\n",
+                             __func__, ret);
+                       return ret;
+               }
        }
 
        rkvop_mode_set(regs, &timing, vop_id);
-- 
1.9.1


_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to