From: Ajay Kumar Date: Wed, 30 Jul 2014 10:02:15 +0000 (+0200) Subject: drm/panel: Provide convenience wrapper for .get_modes() X-Git-Tag: v3.17-rc1~82^2~2^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7bf93c73adb28d8db6b34c27d3edd96337a2d366;p=platform%2Fkernel%2Flinux-exynos.git 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 [treding: extract from larger patch, commit message] Signed-off-by: Thierry Reding --- diff --git a/include/drm/drm_panel.h b/include/drm/drm_panel.h index 29e3daf..1fbcc96 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) 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);