summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/fsl-dcu
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2019-08-04 22:16:26 +0200
committerSam Ravnborg <sam@ravnborg.org>2019-08-10 15:41:48 +0200
commit24bc3e9ce68a41c73b32af8cd077fdf26b31516c (patch)
treee4146840c9ba185c4589f173a5aa5f23780ef250 /drivers/gpu/drm/fsl-dcu
parent90fbc5105653c1c757eb5889b32106cdd754e69f (diff)
drm/fsl-dcu: fix opencoded use of drm_panel_*
Use drm_panel_get_modes() to access modes. This has a nice side effect to simplify the code. drm_panel_get_modes() may return a negative value if for example panel is NULL. This is a small change compared to before, but really what we want. v2: - Add more info to changelog (Stefan) Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Stefan Agner <stefan@agner.ch> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Cc: Alison Wang <alison.wang@nxp.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190804201637.1240-6-sam@ravnborg.org
Diffstat (limited to 'drivers/gpu/drm/fsl-dcu')
-rw-r--r--drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
index 279d83eaffc0..a92fd6c70b09 100644
--- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
+++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c
@@ -65,17 +65,9 @@ static const struct drm_connector_funcs fsl_dcu_drm_connector_funcs = {
static int fsl_dcu_drm_connector_get_modes(struct drm_connector *connector)
{
struct fsl_dcu_drm_connector *fsl_connector;
- int (*get_modes)(struct drm_panel *panel);
- int num_modes = 0;
fsl_connector = to_fsl_dcu_connector(connector);
- if (fsl_connector->panel && fsl_connector->panel->funcs &&
- fsl_connector->panel->funcs->get_modes) {
- get_modes = fsl_connector->panel->funcs->get_modes;
- num_modes = get_modes(fsl_connector->panel);
- }
-
- return num_modes;
+ return drm_panel_get_modes(fsl_connector->panel);
}
static int fsl_dcu_drm_connector_mode_valid(struct drm_connector *connector,