diff options
author | Jani Nikula <jani.nikula@intel.com> | 2024-03-08 19:03:39 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-03 16:32:21 +0300 |
commit | bdaf2fdf2345d931175af9cd7a65fcd677e54614 (patch) | |
tree | d596684dce0acf68837c013cdd867615b75c8d09 /include/drm | |
parent | 394b6d8bbdf9ddee6d5bcf3e1f3e9f23eecd6484 (diff) | |
download | linux-bdaf2fdf2345d931175af9cd7a65fcd677e54614.tar.xz |
drm/probe-helper: warn about negative .get_modes()
[ Upstream commit 7af03e688792293ba33149fb8df619a8dff90e80 ]
The .get_modes() callback is supposed to return the number of modes,
never a negative error code. If a negative value is returned, it'll just
be interpreted as a negative count, and added to previous calculations.
Document the rules, but handle the negative values gracefully with an
error message.
Cc: stable@vger.kernel.org
Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/50208c866facc33226a3c77b82bb96aeef8ef310.1709913674.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/drm')
-rw-r--r-- | include/drm/drm_modeset_helper_vtables.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/drm/drm_modeset_helper_vtables.h b/include/drm/drm_modeset_helper_vtables.h index 881b03e4dc28..9ed42469540e 100644 --- a/include/drm/drm_modeset_helper_vtables.h +++ b/include/drm/drm_modeset_helper_vtables.h @@ -898,7 +898,8 @@ struct drm_connector_helper_funcs { * * RETURNS: * - * The number of modes added by calling drm_mode_probed_add(). + * The number of modes added by calling drm_mode_probed_add(). Return 0 + * on failures (no modes) instead of negative error codes. */ int (*get_modes)(struct drm_connector *connector); |