drm/panel: Provide convenience wrapper for .get_modes()
authorAjay Kumar <ajaykumar.rs@samsung.com>
Wed, 30 Jul 2014 10:02:15 +0000 (12:02 +0200)
committerThierry Reding <treding@nvidia.com>
Wed, 6 Aug 2014 14:44:09 +0000 (16:44 +0200)
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>
include/drm/drm_panel.h

index 29e3daf1b25db5f83d2afe5ce2ce4decc1ef695f..1fbcc96063a7ff7ed72f3be91a3cb47f0d6142dd 100644 (file)
@@ -112,6 +112,14 @@ static inline int drm_panel_enable(struct drm_panel *panel)
        return panel ? -ENOSYS : -EINVAL;
 }
 
+static inline int drm_panel_get_modes(struct drm_panel *panel)
+{
+       if (panel && panel->funcs && panel->funcs->get_modes)
+               return panel->funcs->get_modes(panel);
+
+       return panel ? -ENOSYS : -EINVAL;
+}
+
 void drm_panel_init(struct drm_panel *panel);
 
 int drm_panel_add(struct drm_panel *panel);