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

Simon Glass sjg at chromium.org
Thu Apr 20 12:29:05 UTC 2017


Hi Eric,

On 19 April 2017 at 22:45, Eric Gao <eric.gao at rock-chips.com> 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 <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) {

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


More information about the U-Boot mailing list