From patchwork Fri May 30 10:10:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 4269551 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5A63EBEEA7 for ; Fri, 30 May 2014 10:14:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 700FE2037B for ; Fri, 30 May 2014 10:14:12 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E728E2034B for ; Fri, 30 May 2014 10:14:10 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WqJnH-0007Ns-UU; Fri, 30 May 2014 10:12:11 +0000 Received: from mailout3.w1.samsung.com ([210.118.77.13]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WqJnA-0007Db-Qk for linux-arm-kernel@lists.infradead.org; Fri, 30 May 2014 10:12:05 +0000 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N6D00LDVTN97W60@mailout3.w1.samsung.com> for linux-arm-kernel@lists.infradead.org; Fri, 30 May 2014 11:11:33 +0100 (BST) X-AuditID: cbfec7f5-b7f626d000004b39-66-5388595517a7 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 25.5C.19257.55958835; Fri, 30 May 2014 11:11:33 +0100 (BST) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N6D00KBSTMKV180@eusync4.samsung.com>; Fri, 30 May 2014 11:11:33 +0100 (BST) From: Andrzej Hajda To: Lee Jones , Jingoo Han , Bryan Wu Subject: [PATCH 1/2] backlight: show brightness even if get_brightness is not implemented Date: Fri, 30 May 2014 12:10:49 +0200 Message-id: <1401444650-12267-2-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1401444650-12267-1-git-send-email-a.hajda@samsung.com> References: <1401444650-12267-1-git-send-email-a.hajda@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAy2Ra0hTYRjHfc9tF1qdpslBLGJa1CIvUfRSEoJ+OEFGIEFllFNPm+CmbM7U oiQt10hNpbk01IXDspp5RU1XzealQKe2RXNLzKWjFC94TyWdffs9z//H8//wsFF+KebHTpSl MnKZKElAcLEvG922oxcvq6JDpiZCoN3Qh8OZe/dRaG4tROCfjRIM6kadKBy3dyDw9eADAg7p BnFYNjKGwbxKKwEfFlax4MiCGcD6MRsOe/JncDjU9oyATmcNgNp+IwL/Lm3gcHYuDFavGjBY qLIi0DDqRuCrdjcKpxybFRO6ZRT2ruUBuNJWjsHaCjsBHTYNEr6X7lisxOjWUieLzvk0hdNl qqc43fBCSP+2ODD60WQOTlfWunDaYWsnaFOnCtANVXfpfq0O0Lqv2Qg9+8uO0fM1NpSeNlqJ C95XuGEJTFJiGiMPPhPLlXSuFCEp74n06epmPAv04GrAYVPkcapsUv2ffSnLj1pCDbhsPqkH 1M/s59j2kI9Q6tVlj0WQh6n1hu/EFvuQYsr4UQO2JJQc5lDDT5qwrcCbjKFKtBaPhJEHqPEK jWfPIyMozdgAtl23j+rtKvYc5ZCRlCa318P8TSd7qZP1GPAqgVcN2MMo41MUcWLpsSCFSKpQ ysRB8cnSerD9z4UWoO86ZQIkGwh28CSRudF8XJSmyJCaAMVGBT68jnOqaD4vQZSRyciTr8uV SYzCBBA2xy8LXJVKjhia9DsnXP7l7/JcdcUBKcMFlFfj2cCXcj4SJXCPgv0RiSdue0XN21zG wDep1dZvSqb72lqJ2DGjZ4Sxu2dZbrUhONQ3JmuhaFe8xf8mNWDWrGfeKA8Qnu6bNB/Syurm 0YN34niNzUuXbn0IPwnC38qY8y0ZBYvpc58FmEIiChWicoXoH/m7FLKtAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140530_031205_012780_757B14C5 X-CRM114-Status: UNSURE ( 7.67 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) Cc: Milo Kim , "open list:FRAMEBUFFER LAYER" , Benjamin Herrenschmidt , "open list:X86 PLATFORM DRIVERS" , Andrzej Hajda , Thierry Reding , Laurent Pinchart , Yijing Wang , Matthew Garrett , Kukjin Kim , Sachin Kamat , Tomi Valkeinen , Geert Uytterhoeven , Daniel Vetter , Jean-Christophe Plagniol-Villard , Dan Carpenter , "open list:PWM SUBSYSTEM" , "moderated list:ARM/S5P EXYNOS AR..." , Mikulas Patocka , "moderated list:ARM/S5P EXYNOS AR..." , Randy Dunlap , open list , Rob Clark , Jon Mason , Joe Perches , "open list:LINUX FOR POWER M..." X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Many implementations of get_brightness operation returns only value of props.brightness field. This change makes such implementations unnecessary. Signed-off-by: Andrzej Hajda --- drivers/video/backlight/backlight.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 19b170d..0ce8823 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -221,6 +221,8 @@ static ssize_t actual_brightness_show(struct device *dev, mutex_lock(&bd->ops_lock); if (bd->ops && bd->ops->get_brightness) rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); + else + rc = sprintf(buf, "%d\n", bd->props.brightness); mutex_unlock(&bd->ops_lock); return rc;