Commit 171b711b authored by Jani Nikula's avatar Jani Nikula

drm/bridge: lt8912b: do not return negative values from .get_modes()

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

Cc: Adrien Grassein <adrien.grassein@gmail.com>
Cc: stable@vger.kernel.org
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/dcdddcbcb64b6f6cdc55022ee50c10dee8ddbc3d.1709913674.git.jani.nikula@intel.comSigned-off-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 13d5b040
...@@ -441,23 +441,21 @@ lt8912_connector_mode_valid(struct drm_connector *connector, ...@@ -441,23 +441,21 @@ lt8912_connector_mode_valid(struct drm_connector *connector,
static int lt8912_connector_get_modes(struct drm_connector *connector) static int lt8912_connector_get_modes(struct drm_connector *connector)
{ {
const struct drm_edid *drm_edid; const struct drm_edid *drm_edid;
int ret = -1;
int num = 0;
struct lt8912 *lt = connector_to_lt8912(connector); struct lt8912 *lt = connector_to_lt8912(connector);
u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24; u32 bus_format = MEDIA_BUS_FMT_RGB888_1X24;
int ret, num;
drm_edid = drm_bridge_edid_read(lt->hdmi_port, connector); drm_edid = drm_bridge_edid_read(lt->hdmi_port, connector);
drm_edid_connector_update(connector, drm_edid); drm_edid_connector_update(connector, drm_edid);
if (drm_edid) { if (!drm_edid)
num = drm_edid_connector_add_modes(connector); return 0;
} else {
return ret; num = drm_edid_connector_add_modes(connector);
}
ret = drm_display_info_set_bus_formats(&connector->display_info, ret = drm_display_info_set_bus_formats(&connector->display_info,
&bus_format, 1); &bus_format, 1);
if (ret) if (ret < 0)
num = ret; num = 0;
drm_edid_free(drm_edid); drm_edid_free(drm_edid);
return num; return num;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment