Subject: [PATCH v1 01/16] drm/bridge: tc358767: fix opencoded use of drm_panel_*

From: Sam Ravnborg <[email-masked]>
Date: Sun, 4 Aug 2019 22:16:22 +0200

Replace open coded version with call to drm_panel_get_modes().

Signed-off-by: Sam Ravnborg <[email-masked]>
Cc: Andrzej Hajda <[email-masked]>
Cc: Neil Armstrong <[email-masked]>
Cc: Laurent Pinchart <[email-masked]>
Cc: Jonas Karlman <[email-masked]>
Cc: Jernej Skrabec <[email-masked]>
---
 drivers/gpu/drm/bridge/tc358767.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c
index 42f03a985ac0..cebc8e620820 100644
--- a/drivers/gpu/drm/bridge/tc358767.c
+++ b/drivers/gpu/drm/bridge/tc358767.c
@@ -1312,7 +1312,7 @@ static int tc_connector_get_modes(struct drm_connector *connector)
 {
 	struct tc_data *tc = connector_to_tc(connector);
 	struct edid *edid;
-	unsigned int count;
+	int count;
 	int ret;
 
 	ret = tc_get_display_props(tc);
@@ -1321,11 +1321,9 @@ static int tc_connector_get_modes(struct drm_connector *connector)
 		return 0;
 	}
 
-	if (tc->panel && tc->panel->funcs && tc->panel->funcs->get_modes) {
-		count = tc->panel->funcs->get_modes(tc->panel);
-		if (count > 0)
-			return count;
-	}
+	count = drm_panel_get_modes(tc->panel);
+	if (count > 0)
+		return count;
 
 	edid = drm_get_edid(connector, &tc->aux.ddc);
 
-- 
2.20.1

_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel