From patchwork Thu Jan 24 07:05:24 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 2029721 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6575A3FD56 for ; Thu, 24 Jan 2013 07:05:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751150Ab3AXHFq (ORCPT ); Thu, 24 Jan 2013 02:05:46 -0500 Received: from aserp1040.oracle.com ([141.146.126.69]:20046 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751056Ab3AXHFp (ORCPT ); Thu, 24 Jan 2013 02:05:45 -0500 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id r0O75Wbg030893 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Jan 2013 07:05:33 GMT Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r0O75V3H016935 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jan 2013 07:05:32 GMT Received: from abhmt112.oracle.com (abhmt112.oracle.com [141.146.116.64]) by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r0O75VLS004066; Thu, 24 Jan 2013 01:05:31 -0600 Received: from elgon.mountain (/41.212.103.53) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 23 Jan 2013 23:05:30 -0800 Date: Thu, 24 Jan 2013 10:05:24 +0300 From: Dan Carpenter To: Richard Purdie Cc: Florian Tobias Schandinat , linux-fbdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] backlight: s6e63m0: report ->gamma_table_count correctly Message-ID: <20130124070524.GD5611@elgon.mountain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: acsinet21.oracle.com [141.146.126.237] Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org gamma_table has 3 arrays which each hold MAX_GAMMA_LEVEL pointers to int. The current code sets ->gamma_table_count to 6 on 64bit arches and to 3 on 32 bit arches. It should be 3 on everything. Signed-off-by: Dan Carpenter --- This is from reading the code. We use ->gamma_table_count in sysfs file but other than that I'm not sure what it's for. I am not very familiar with this code. -- To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/video/backlight/s6e63m0.c b/drivers/video/backlight/s6e63m0.c index 2126b96..9c2677f 100644 --- a/drivers/video/backlight/s6e63m0.c +++ b/drivers/video/backlight/s6e63m0.c @@ -766,7 +766,7 @@ static int s6e63m0_probe(struct spi_device *spi) * know that. */ lcd->gamma_table_count = - sizeof(gamma_table) / (MAX_GAMMA_LEVEL * sizeof(int)); + sizeof(gamma_table) / (MAX_GAMMA_LEVEL * sizeof(int *)); ret = device_create_file(&(spi->dev), &dev_attr_gamma_mode); if (ret < 0)