diff options
Diffstat (limited to 'drivers/video/fbdev/sm501fb.c')
-rw-r--r-- | drivers/video/fbdev/sm501fb.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/video/fbdev/sm501fb.c b/drivers/video/fbdev/sm501fb.c index d6fdc1737cd2..ed6f4f43e2d5 100644 --- a/drivers/video/fbdev/sm501fb.c +++ b/drivers/video/fbdev/sm501fb.c @@ -27,6 +27,7 @@ #include <linux/clk.h> #include <linux/console.h> #include <linux/io.h> +#include <linux/string_choices.h> #include <linux/uaccess.h> #include <asm/div64.h> @@ -326,6 +327,13 @@ static int sm501fb_check_var(struct fb_var_screeninfo *var, if (var->xres_virtual > 4096 || var->yres_virtual > 2048) return -EINVAL; + /* geometry sanity checks */ + if (var->xres + var->xoffset > var->xres_virtual) + return -EINVAL; + + if (var->yres + var->yoffset > var->yres_virtual) + return -EINVAL; + /* can cope with 8,16 or 32bpp */ if (var->bits_per_pixel <= 8) @@ -1712,8 +1720,8 @@ static int sm501fb_init_fb(struct fb_info *fb, enum sm501_controller head, BUG(); } - dev_info(info->dev, "fb %s %sabled at start\n", - fbname, enable ? "en" : "dis"); + dev_info(info->dev, "fb %s %s at start\n", + fbname, str_enabled_disabled(enable)); /* check to see if our routing allows this */ @@ -2211,7 +2219,7 @@ static int sm501fb_resume(struct platform_device *pdev) static struct platform_driver sm501fb_driver = { .probe = sm501fb_probe, - .remove_new = sm501fb_remove, + .remove = sm501fb_remove, .suspend = sm501fb_suspend, .resume = sm501fb_resume, .driver = { |