summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-04 07:23:41 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-04 07:23:41 +0000
commitbe96363cc9978d3a36d9c9cfc921aafb10ac58b8 (patch)
treec724242d92cdb49b9f89fbb8b2d9ab83633eae6e /sys
parent4fe11fc5ab1ff8bbd4e05b843e240fff2100c85e (diff)
drm/panel: do not return negative error codes from drm_panel_get_modes()
From Jani Nikula a686732df6cecc3561595e6ce7a962a0121eed00 in linux-6.6.y/6.6.24 fc4e97726530241d96dd7db72eb65979217422c9 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/drm_panel.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/pci/drm/drm_panel.c b/sys/dev/pci/drm/drm_panel.c
index 10b107e1783..e2bd20b2b1b 100644
--- a/sys/dev/pci/drm/drm_panel.c
+++ b/sys/dev/pci/drm/drm_panel.c
@@ -274,19 +274,24 @@ EXPORT_SYMBOL(drm_panel_disable);
* The modes probed from the panel are automatically added to the connector
* that the panel is attached to.
*
- * Return: The number of modes available from the panel on success or a
- * negative error code on failure.
+ * Return: The number of modes available from the panel on success, or 0 on
+ * failure (no modes).
*/
int drm_panel_get_modes(struct drm_panel *panel,
struct drm_connector *connector)
{
if (!panel)
- return -EINVAL;
+ return 0;
- if (panel->funcs && panel->funcs->get_modes)
- return panel->funcs->get_modes(panel, connector);
+ if (panel->funcs && panel->funcs->get_modes) {
+ int num;
- return -EOPNOTSUPP;
+ num = panel->funcs->get_modes(panel, connector);
+ if (num > 0)
+ return num;
+ }
+
+ return 0;
}
EXPORT_SYMBOL(drm_panel_get_modes);