diff options
author | Ajay Kumar <ajaykumar.rs@samsung.com> | 2014-07-30 06:02:15 -0400 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-08-06 10:44:09 -0400 |
commit | 7bf93c73adb28d8db6b34c27d3edd96337a2d366 (patch) | |
tree | c08c94f1948901bd05f7fff827f5ba9da90fea9c | |
parent | 45527d435c5e39b6eec4aa0065a562e7cf05d503 (diff) |
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>
-rw-r--r-- | include/drm/drm_panel.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 29e3daf1b25d..1fbcc96063a7 100644 --- a/include/drm/drm_panel.h +++ b/include/drm/drm_panel.h | |||
@@ -112,6 +112,14 @@ static inline int drm_panel_enable(struct drm_panel *panel) | |||
112 | return panel ? -ENOSYS : -EINVAL; | 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 | void drm_panel_init(struct drm_panel *panel); | 123 | void drm_panel_init(struct drm_panel *panel); |
116 | 124 | ||
117 | int drm_panel_add(struct drm_panel *panel); | 125 | int drm_panel_add(struct drm_panel *panel); |