[media] adv7604: corrected edid crc-calculation
authorMartin Bugge <marbugge@cisco.com>
Wed, 14 Aug 2013 12:25:48 +0000 (09:25 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Sat, 24 Aug 2013 07:25:23 +0000 (04:25 -0300)
Signed-off-by: Martin Bugge <marbugge@cisco.com>
Reviewed-by: Mats Randgaard <matrandg@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/ad9389b.c

index 545aabbdae6821835fd75d028d21420d1f455365..d78fd3d634ac3c0286795cb8c43d23b191f60178 100644 (file)
@@ -983,12 +983,12 @@ static void ad9389b_check_monitor_present_status(struct v4l2_subdev *sd)
 
 static bool edid_block_verify_crc(u8 *edid_block)
 {
-       int i;
        u8 sum = 0;
+       int i;
 
-       for (i = 0; i < 127; i++)
-               sum += *(edid_block + i);
-       return ((255 - sum + 1) == edid_block[127]);
+       for (i = 0; i < 128; i++)
+               sum += edid_block[i];
+       return sum == 0;
 }
 
 static bool edid_segment_verify_crc(struct v4l2_subdev *sd, u32 segment)