From: Ville Syrjala Date: Tue, 4 Mar 2008 22:28:49 +0000 (-0800) Subject: sm501fb: fix timing limits X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7e533705bd973267c488f8c3a7c7246ecad3a414;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git sm501fb: fix timing limits Vertical sync height register can only hold 6 bits. Fix the hsync start test to use > instead of >=. Also add a few clarifying comments. Signed-off-by: Ville Syrjala Acked-by: Ben Dooks Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/sm501fb.c b/drivers/video/sm501fb.c index f49287c88abe..742b5c656d66 100644 --- a/drivers/video/sm501fb.c +++ b/drivers/video/sm501fb.c @@ -237,12 +237,14 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var, /* check we can fit these values into the registers */ - if (var->hsync_len > 255 || var->vsync_len > 255) + if (var->hsync_len > 255 || var->vsync_len > 63) return -EINVAL; - if ((var->xres + var->right_margin) >= 4096) + /* hdisplay end and hsync start */ + if ((var->xres + var->right_margin) > 4096) return -EINVAL; + /* vdisplay end and vsync start */ if ((var->yres + var->lower_margin) > 2048) return -EINVAL;