trivial: atmel_lcdfb: add missing error message
authorRichard Genoud <richard.genoud@gmail.com>
Fri, 31 May 2013 14:28:38 +0000 (14:28 +0000)
committerJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Fri, 31 May 2013 19:18:30 +0000 (03:18 +0800)
When a too small framebuffer is given, the atmel_lcdfb_check_var
silently fails.
Adding an error message will save some head scratching.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
drivers/video/atmel_lcdfb.c

index 540909de6247b19daabb6fc6affa650fe6a70f9a..6e6491fb83b7d72706f503966c6ffdd6a767bc14 100644 (file)
@@ -461,8 +461,11 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
        if (info->fix.smem_len) {
                unsigned int smem_len = (var->xres_virtual * var->yres_virtual
                                         * ((var->bits_per_pixel + 7) / 8));
-               if (smem_len > info->fix.smem_len)
+               if (smem_len > info->fix.smem_len) {
+                       dev_err(dev, "Frame buffer is too small (%u) for screen size (need at least %u)\n",
+                               info->fix.smem_len, smem_len);
                        return -EINVAL;
+               }
        }
 
        /* Saturate vertical and horizontal timings at maximum values */