Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/panel: Provide convenience wrapper for .get_modes()

Add a convenience wrapper for the struct drm_panel_funcs' .get_modes()
function so that not every driver needs to check that the panel driver
implements the function before calling it.

Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com>
[treding: extract from larger patch, commit message]
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Ajay Kumar and committed by
Thierry Reding
7bf93c73 45527d43

+8
+8
include/drm/drm_panel.h
··· 112 112 return panel ? -ENOSYS : -EINVAL; 113 113 } 114 114 115 + static inline int drm_panel_get_modes(struct drm_panel *panel) 116 + { 117 + if (panel && panel->funcs && panel->funcs->get_modes) 118 + return panel->funcs->get_modes(panel); 119 + 120 + return panel ? -ENOSYS : -EINVAL; 121 + } 122 + 115 123 void drm_panel_init(struct drm_panel *panel); 116 124 117 125 int drm_panel_add(struct drm_panel *panel);