Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livep...
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / drm / drm_edid.c
index 977915cf530a70e913aebb96f3c980c65f4cce8d..d5d2c03fd1369b904e31af5184c05e4b9da0f82d 100644 (file)
@@ -2538,9 +2538,9 @@ cea_mode_alternate_clock(const struct drm_display_mode *cea_mode)
         * and the 60Hz variant otherwise.
         */
        if (cea_mode->vdisplay == 240 || cea_mode->vdisplay == 480)
-               clock = clock * 1001 / 1000;
+               clock = DIV_ROUND_CLOSEST(clock * 1001, 1000);
        else
-               clock = DIV_ROUND_UP(clock * 1000, 1001);
+               clock = DIV_ROUND_CLOSEST(clock * 1000, 1001);
 
        return clock;
 }