drm/stm: ltdc: return appropriate error code during probe
authorFabien Dessenne <fabien.dessenne@st.com>
Wed, 24 Apr 2019 14:03:21 +0000 (16:03 +0200)
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>
Mon, 6 May 2019 07:22:15 +0000 (09:22 +0200)
During probe, return the "clk_get" error value instead of -ENODEV.

Signed-off-by: Fabien Dessenne <fabien.dessenne@st.com>
Acked-by: Philippe Cornu <philippe.cornu@st.com>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/1556114601-30936-3-git-send-email-fabien.dessenne@st.com
drivers/gpu/drm/stm/ltdc.c

index 521ba83545db5b2a566517fe98b2842bab847be1..97912e2c663d4e26f51bd940dd4ddb0ccc35f20e 100644 (file)
@@ -1145,8 +1145,9 @@ int ltdc_load(struct drm_device *ddev)
 
        ldev->pixel_clk = devm_clk_get(dev, "lcd");
        if (IS_ERR(ldev->pixel_clk)) {
-               DRM_ERROR("Unable to get lcd clock\n");
-               return -ENODEV;
+               if (PTR_ERR(ldev->pixel_clk) != -EPROBE_DEFER)
+                       DRM_ERROR("Unable to get lcd clock\n");
+               return PTR_ERR(ldev->pixel_clk);
        }
 
        if (clk_prepare_enable(ldev->pixel_clk)) {