Skip to content

Commit

Permalink
trivial: atmel_lcdfb: add missing error message
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Genoud authored and Jean-Christophe PLAGNIOL-VILLARD committed May 31, 2013
1 parent 2436e8a commit 65ac057
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/video/atmel_lcdfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 65ac057

Please sign in to comment.