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....@rock-chips.com> --- 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 _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot