]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
video: rockchip: dw_mipi_dsi: Correct check for lacking phy phandle
authorOndrej Jirman <megi@xff.cz>
Mon, 22 May 2023 21:47:07 +0000 (23:47 +0200)
committerAnatolij Gustschin <agust@denx.de>
Fri, 14 Jul 2023 16:29:11 +0000 (18:29 +0200)
If phy is not defined in DT (eg. on rk3399), generic_phy_get_by_name
will return -ENODATA. Handle that case correctly.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
drivers/video/rockchip/dw_mipi_dsi_rockchip.c

index 6d8b1e6f541a62802395efe04e90d58b60dfe67b..fd885ac8ccb69c5ea1d0ab62f535a6a4439a659b 100644 (file)
@@ -814,9 +814,9 @@ static int dw_mipi_dsi_rockchip_probe(struct udevice *dev)
         * NULL if it's not initialized.
         */
        ret = generic_phy_get_by_name(dev, "dphy", &priv->phy);
-       if ((ret) && (ret != -ENODEV)) {
+       if (ret && ret != -ENODATA) {
                dev_err(dev, "failed to get mipi dphy: %d\n", ret);
-               return -EINVAL;
+               return ret;
        }
 
        priv->pclk = devm_clk_get(dev, "pclk");