From patchwork Fri May 31 14:28:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Genoud X-Patchwork-Id: 2644211 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 32E57DFB79 for ; Fri, 31 May 2013 14:28:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753101Ab3EaO2w (ORCPT ); Fri, 31 May 2013 10:28:52 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:37565 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752904Ab3EaO2v (ORCPT ); Fri, 31 May 2013 10:28:51 -0400 Received: by mail-wi0-f172.google.com with SMTP id m6so748684wiv.11 for ; Fri, 31 May 2013 07:28:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=P+GMkPalBsLl542xRpM1fACmLLkfLJjR2MSNJvjB3z0=; b=JztDWPbcBKfZqN0314NTRY+KtcoEq2STwCQhEVSUV5ILPeECjZanRDtbu0vVlbcq7c EihZZe8SePptKtzhrc58VbPua78LgiQ6QOcH5NTu5t5w0BxJCtNC10IX54sAiNDd+w5B sOnSmjtqaXbh53F13l/CoGuHWoUfY/IrWZQLG+tmyhBjSXOmoVxm0fb88eQ8gklEhDV3 Pvvj8gCBMnAFV28zN1EIfoIGDfEux+ZRJOU6dtyPV0QWt7nYzDWoImgT3fyrLlttJoUd ne00YHBL7H0Z55VBBTPaVD+HjE+KpQ20qvylMrPV157CGT2KKDumVArkALpqKqi7Ha1I v56g== X-Received: by 10.194.87.71 with SMTP id v7mr9683490wjz.33.1370010530040; Fri, 31 May 2013 07:28:50 -0700 (PDT) Received: from lnx-rg.pr (lyon.paratronic.fr. [213.41.177.106]) by mx.google.com with ESMTPSA id fp16sm4336079wic.6.2013.05.31.07.28.48 for (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 07:28:49 -0700 (PDT) From: Richard Genoud To: Nicolas Ferre Cc: Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Genoud Subject: [PATCH 1/2] trivial: atmel_lcdfb: add missing error message Date: Fri, 31 May 2013 16:28:38 +0200 Message-Id: <1370010519-18691-1-git-send-email-richard.genoud@gmail.com> X-Mailer: git-send-email 1.7.10.4 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org 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 --- drivers/video/atmel_lcdfb.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c index 540909d..6e6491f 100644 --- a/drivers/video/atmel_lcdfb.c +++ b/drivers/video/atmel_lcdfb.c @@ -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 */