[U-Boot] [PATCH v4 05/11] rockchip: video: vop: Fix rk_display_init() return error

Eric Gao eric.gao at rock-chips.com
Thu Apr 20 04:45:53 UTC 2017


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.gao at 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




More information about the U-Boot mailing list