[U-Boot] [PATCH v2 8/8] rockchip: video: vop: Fix rk_display_init() return error

Eric Gao eric.gao at rock-chips.com
Tue Apr 18 07:09:42 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 an error
when it return zero rather than return a nonzero value.

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

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

 drivers/video/rockchip/rk_vop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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




More information about the U-Boot mailing list