Skip to content

Commit

Permalink
drm/exynos: do not return negative values from .get_modes()
Browse files Browse the repository at this point in the history
[ Upstream commit 13d5b04 ]

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>
  • Loading branch information
jnikula authored and gregkh committed Apr 3, 2024
1 parent 2bdc60d commit 1cef1ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/exynos/exynos_drm_vidi.c
Expand Up @@ -316,14 +316,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);
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/exynos/exynos_hdmi.c
Expand Up @@ -887,11 +887,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 = !connector->display_info.is_hdmi;
DRM_DEV_DEBUG_KMS(hdata->dev, "%s : width[%d] x height[%d]\n",
Expand Down

0 comments on commit 1cef1ef

Please sign in to comment.