]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/exynos: do not return negative values from .get_modes()
authorJani Nikula <jani.nikula@intel.com>
Fri, 8 Mar 2024 16:03:41 +0000 (18:03 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 13 Apr 2024 10:58:37 +0000 (12:58 +0200)
[ Upstream commit 13d5b040363c7ec0ac29c2de9cf661a24a8aa531 ]

The .get_modes() hooks aren't supposed to return negative error
codes. Return 0 for no modes, whatever the reason.

Cc: Inki Dae <inki.dae@samsung.com>
Cc: Seung-Woo Kim <sw0312.kim@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: stable@vger.kernel.org
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/d8665f620d9c252aa7d5a4811ff6b16e773903a2.1709913674.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_hdmi.c

index e96436e11a36c9f72c391a7776406e4fa34d536a..e1ffe8a28b6496313ff4f1df7099334c59bd72b6 100644 (file)
@@ -315,14 +315,14 @@ static int vidi_get_modes(struct drm_connector *connector)
         */
        if (!ctx->raw_edid) {
                DRM_DEV_DEBUG_KMS(ctx->dev, "raw_edid is null.\n");
-               return -EFAULT;
+               return 0;
        }
 
        edid_len = (1 + ctx->raw_edid->extensions) * EDID_LENGTH;
        edid = kmemdup(ctx->raw_edid, edid_len, GFP_KERNEL);
        if (!edid) {
                DRM_DEV_DEBUG_KMS(ctx->dev, "failed to allocate edid\n");
-               return -ENOMEM;
+               return 0;
        }
 
        drm_connector_update_edid_property(connector, edid);
index 981bffacda2437398d378719a1173a78c7937d14..576fcf18071643f4b3503ee1c5c3af956b43a10e 100644 (file)
@@ -878,11 +878,11 @@ static int hdmi_get_modes(struct drm_connector *connector)
        int ret;
 
        if (!hdata->ddc_adpt)
-               return -ENODEV;
+               return 0;
 
        edid = drm_get_edid(connector, hdata->ddc_adpt);
        if (!edid)
-               return -ENODEV;
+               return 0;
 
        hdata->dvi_mode = !drm_detect_hdmi_monitor(edid);
        DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",