From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Thu, 20 Apr 2017 06:29:05 -0600 Subject: [U-Boot] [PATCH v4 05/11] rockchip: video: vop: Fix rk_display_init() return error In-Reply-To: <1492663559-8248-6-git-send-email-eric.gao@rock-chips.com> References: <1492663559-8248-1-git-send-email-eric.gao@rock-chips.com> <1492663559-8248-6-git-send-email-eric.gao@rock-chips.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Eric, On 19 April 2017 at 22:45, Eric Gao wrote: > 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 > --- > > 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) { I think you need: if IS_ERR_VALUE(ret) since otherwise this breaks firefly-rk3288 HDMI. > + debug("%s: Failed to set pixel clock: ret=%d\n", > + __func__, ret); > + return ret; > + } > } > > rkvop_mode_set(regs, &timing, vop_id); > -- > 1.9.1 > > Regards, Simon