From 14dd77fdc4d5f2d55cf2dfcd97891e436a0aaf99 Mon Sep 17 00:00:00 2001 From: Ondrej Jirman Date: Mon, 22 May 2023 23:47:04 +0200 Subject: [PATCH] video: rockchip: dw_mipi_dsi: Fix error path checks in probe function Wrong return codes were checked in several places. Check the proper ones. Signed-off-by: Ondrej Jirman --- drivers/video/rockchip/dw_mipi_dsi_rockchip.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/video/rockchip/dw_mipi_dsi_rockchip.c b/drivers/video/rockchip/dw_mipi_dsi_rockchip.c index b1b5328..b7d6b51 100644 --- a/drivers/video/rockchip/dw_mipi_dsi_rockchip.c +++ b/drivers/video/rockchip/dw_mipi_dsi_rockchip.c @@ -822,6 +822,7 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev) priv->pclk = devm_clk_get(dev, "pclk"); if (IS_ERR(priv->pclk)) { + ret = PTR_ERR(priv->pclk); dev_err(dev, "peripheral clock get error %d\n", ret); return ret; } @@ -833,7 +834,8 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev) } else { priv->ref = devm_clk_get(dev, "ref"); - if (ret) { + if (IS_ERR(priv->ref)) { + ret = PTR_ERR(priv->ref); dev_err(dev, "pll reference clock get error %d\n", ret); return ret; } @@ -841,7 +843,8 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev) priv->rst = devm_reset_control_get_by_index(device->dev, 0); if (IS_ERR(priv->rst)) { - dev_err(dev, "missing dsi hardware reset\n"); + ret = PTR_ERR(priv->rst); + dev_err(dev, "missing dsi hardware reset %d\n", ret); return ret; } -- 2.7.4