Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1657363iog; Thu, 16 Jun 2022 10:49:42 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vfWFAPDxetpfaaZLMS5GRs/qIcMeEaP3Zregm6IX5L/BU9xoQCC/PAj1IfLC1JBOjIN0r1 X-Received: by 2002:a63:77ce:0:b0:409:fc0f:5d19 with SMTP id s197-20020a6377ce000000b00409fc0f5d19mr4316644pgc.129.1655401782504; Thu, 16 Jun 2022 10:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655401782; cv=none; d=google.com; s=arc-20160816; b=m4CuBhGC4A2aNE31imL8szmHJlJeiKzd4Fjgpe2RZ/2NbJUWvedQ43MknHvU1yEO03 RChKyY2kw2J7794PKybl3IZWumrgSURWRBBXIoXob9/aw91nslnOX9XWz5orIAo8/U+T Zo5elQBMyUH7vsM/440vX2Z5ZmCtsxk+G8cgDy6hFdft4J73g/DhK8jYiKsZZ+LZudht Zz9uxLAPJCGd7gpQm4KWNuEN+h6wH8QSWsC4hjb4H3+JlITzx1S3J+pF4/PG4H5Mdx20 yfIbyZ0QN+deRmCdK2TUdf/fq13wOpLsk0+nabJ5ESUEzmSKQxav+ImkeRy2b092nvDX A29Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MUPDlaJsvMvk9XuZtXrHH4v/CmLPpIKPDhKYahmnIVM=; b=ovkNyikX+JYkeQ7JbK9cy3oi0Ho1IRjZF341rStlk3B+YOPfB3j7xOx1nNSu3doK3O 77PCYUjCqO8d3IDWOxz22xtsKLhiLvCP15XfQOScYGfnUZ1Z+ZobMbkxnD+xCnQFV/8M /ZjxZb+LMVRtVZOMLfr4bbk39vXWyuBrK+cZNsIw8oqD4UmEfFw4H84EOopJqk/ATQtb CSLlu2hN+JE5Bk9RPTfOgEV4igpkXDtwIuoDrfKltAxbkm5bCNZueApMTJhy8pWjo6fR W/+dH4Rb4V0sJf79U1yjLj+OQdDQf9g5yrrbRl1jh5WB3es7YP4ssiHgR1BVFrBBgK+B sxTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d2-20020a056a00244200b0051c3dcbe8ffsi3210428pfj.373.2022.06.16.10.49.30; Thu, 16 Jun 2022 10:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232898AbiFPR2M (ORCPT + 99 others); Thu, 16 Jun 2022 13:28:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229512AbiFPR2L (ORCPT ); Thu, 16 Jun 2022 13:28:11 -0400 X-Greylist: delayed 1387 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 16 Jun 2022 10:28:08 PDT Received: from 18.mo584.mail-out.ovh.net (18.mo584.mail-out.ovh.net [188.165.54.143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24DAA175AF for ; Thu, 16 Jun 2022 10:28:03 -0700 (PDT) Received: from player779.ha.ovh.net (unknown [10.109.156.34]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 955C32222D for ; Thu, 16 Jun 2022 17:08:40 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player779.ha.ovh.net (Postfix) with ESMTPSA id 64B292B9393D5; Thu, 16 Jun 2022 17:08:32 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-103G0059eda0aa4-c3b8-493b-af8c-1b5db0bc1ce2, EEA695ED62D0B30D35F9F30395731DD21189161B) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Laurent Pinchart , Kieran Bingham Cc: Stephen Kitt , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] drm: shmobile: Use backlight helper Date: Thu, 16 Jun 2022 19:08:21 +0200 Message-Id: <20220616170821.1348169-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 7176486009031853787 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddvfedguddtfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejjeelrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekge X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This started with work on the removal of backlight_properties' deprecated fb_blank field, much of which can be taken care of by using helper functions provided by backlight.h instead of directly accessing fields in backlight_properties. This patch series doesn't involve fb_blank, but it still seems useful to use helper functions where appropriate. Instead of retrieving the backlight brightness in struct backlight_properties manually, and then checking whether the backlight should be on at all, use backlight_get_brightness() which does all this and insulates this from future changes. Signed-off-by: Stephen Kitt Cc: Laurent Pinchart Cc: Kieran Bingham Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel@lists.freedesktop.org --- Changes since v1: clarified commit message, this doesn't touch fb_blank --- drivers/gpu/drm/shmobile/shmob_drm_backlight.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c index f6628a5ee95f..794573badfe8 100644 --- a/drivers/gpu/drm/shmobile/shmob_drm_backlight.c +++ b/drivers/gpu/drm/shmobile/shmob_drm_backlight.c @@ -18,11 +18,7 @@ static int shmob_drm_backlight_update(struct backlight_device *bdev) struct shmob_drm_connector *scon = bl_get_data(bdev); struct shmob_drm_device *sdev = scon->connector.dev->dev_private; const struct shmob_drm_backlight_data *bdata = &sdev->pdata->backlight; - int brightness = bdev->props.brightness; - - if (bdev->props.power != FB_BLANK_UNBLANK || - bdev->props.state & BL_CORE_SUSPENDED) - brightness = 0; + int brightness = backlight_get_brightness(bdev); return bdata->set_brightness(brightness); } base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 -- 2.30.2