Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65ac057b authored by Richard Genoud's avatar Richard Genoud Committed by Jean-Christophe PLAGNIOL-VILLARD
Browse files

trivial: atmel_lcdfb: add missing error message



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: default avatarRichard Genoud <richard.genoud@gmail.com>
Signed-off-by: default avatarJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
parent 2436e8aa
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -461,9 +461,12 @@ 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 */
	var->vsync_len = min_t(u32, var->vsync_len,