diff mbox

[5/6] drm/edid: add drm_edid_dump helper function

Message ID 49cee0de-172b-4b5d-842a-eb1baeafde44@HUB1.rwth-ad.de (mailing list archive)
State New, archived
Headers show

Commit Message

Stefan Brüns Nov. 30, 2014, 6:57 p.m. UTC
This function will also be used by drm_edid_block_valid after the
next patch in the series.

Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de>
---
 drivers/gpu/drm/drm_edid.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index d68f56d..31988ca 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -1032,6 +1032,17 @@  static bool drm_edid_is_zero(const u8 *in_edid, int length)
 	return true;
 }
 
+static void drm_dump_edid(const u8 *raw_edid)
+{
+	if (drm_edid_is_zero(raw_edid, EDID_LENGTH)) {
+		printk(KERN_ERR "EDID block is all zeroes\n");
+	} else {
+		printk(KERN_ERR "Raw EDID:\n");
+		print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1,
+		       raw_edid, EDID_LENGTH, false);
+	}
+}
+
 /**
  * drm_edid_block_valid - Sanity check the EDID block (base or extension)
  * @raw_edid: pointer to raw EDID block
@@ -1095,15 +1106,9 @@  bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid)
 	return true;
 
 bad:
-	if (print_bad_edid) {
-		if (drm_edid_is_zero(raw_edid, EDID_LENGTH)) {
-			printk(KERN_ERR "EDID block is all zeroes\n");
-		} else {
-			printk(KERN_ERR "Raw EDID:\n");
-			print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1,
-			       raw_edid, EDID_LENGTH, false);
-		}
-	}
+	if (print_bad_edid)
+		drm_dump_edid(raw_edid);
+
 	return false;
 }
 EXPORT_SYMBOL(drm_edid_block_valid);