Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp3140833rwl; Fri, 6 Jan 2023 16:34:37 -0800 (PST) X-Google-Smtp-Source: AMrXdXtqEdrewo3mme6E8RNHyyLLKHO0KUK/4kW6o6g9lOWnwQ3J//52HoQm2HkSlW2Pxls61yu0 X-Received: by 2002:a17:902:edc3:b0:189:e577:c83d with SMTP id q3-20020a170902edc300b00189e577c83dmr51461169plk.66.1673051677044; Fri, 06 Jan 2023 16:34:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673051677; cv=none; d=google.com; s=arc-20160816; b=AeV8YKkICAPNzu+GknJA0zk8Y47+sxK/oxF6KDcCUGuNPdoUEFd3uWUDbIxp9izvUP uYTbIWGl3aaLAUkuJBh8ujf4I0bh8wwK0NOfrVCIS1ab069JHpkeap2VDnyOoygcZ8Z3 wFTV/rO4MY1S7DJKfNwYDOZJPyz1tMeM7OAit+g4ABcTSsPJu1+iOmJ50gnzuVBwjGNz r14g78UaTW/O8nQ1mqXKOT90j+/eCXOjw+l5MuYqmdSDq1dyPSetS0IbFPIHI1He9dYn KJXyp/rx/TFuCyBqvER8R4FxrtJK/dPSYvgDcy5t8P2ysj5AjY7voKD3H73JsClHoT8v ARZg== 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=MQ96qZz3YLpiKAEhsqpjZCyVKVw55aOz2bvmrCPIhPo=; b=ow5OuFo3Ovz05Y1XDtgvNTm/Xc0831jCihtbI5reJ6ijXGVxEJNuQzVmvNOiHaKvBK Jc6+H4trAank7VTDnmFfpiX84ZHQEVtuUoxSjS0AooBjQjHEurpoQLX4L00eFa1SCtir tL0D9EsaftOOH8kwbFaRekiWtYSN5x2b8vElml5gdDWHMk++zHyxueS7mWYWUOzgE7SR /x03XkxmZu46/OYKHZzeQCNtupWHZ69jrgh2UaOcsq3dIBRiiBchL+RoDHBjzodhEDn1 uXfH+CH5Ew8bN7ySAz+OdAO/11d/UqH2dSCACfgKTXxPFDtMdDp/dUjm+b7uZwP7ZQ8L WGXQ== 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 b4-20020a170903228400b00188f882599csi2871633plh.58.2023.01.06.16.34.29; Fri, 06 Jan 2023 16:34:36 -0800 (PST) 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 S236614AbjAGAAE (ORCPT + 55 others); Fri, 6 Jan 2023 19:00:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236676AbjAFX72 (ORCPT ); Fri, 6 Jan 2023 18:59:28 -0500 X-Greylist: delayed 25756 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 06 Jan 2023 15:59:17 PST Received: from 20.mo584.mail-out.ovh.net (20.mo584.mail-out.ovh.net [46.105.33.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE4FB1BC9E for ; Fri, 6 Jan 2023 15:59:17 -0800 (PST) Received: from director9.ghost.mail-out.ovh.net (unknown [10.109.143.136]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id AE40A23444 for ; Fri, 6 Jan 2023 16:49:59 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-dkv5l (unknown [10.110.171.46]) by director9.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0C2171FE9B; Fri, 6 Jan 2023 16:49:59 +0000 (UTC) Received: from sk2.org ([37.59.142.107]) by ghost-submission-6684bf9d7b-dkv5l with ESMTPSA id eB+zADdRuGOnAQEAwhnnFg (envelope-from ); Fri, 06 Jan 2023 16:49:59 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S00109038e94-ae10-4a84-be5c-29fce71eaa6f, 9FE29456621203A27B372E1E0503D45BE0167874) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Lee Jones , Daniel Thompson , Jingoo Han Cc: Sam Ravnborg , Stephen Kitt , Helge Deller , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RESEND 2/4] backlight: arcxcnn: Use backlight helper Date: Fri, 6 Jan 2023 17:48:53 +0100 Message-Id: <20230106164856.1453819-3-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 5852146243471509211 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrkedtgdelhecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehsthgvvhgvsehskhdvrdhorhhgqedpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 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 --- drivers/video/backlight/arcxcnn_bl.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/video/backlight/arcxcnn_bl.c b/drivers/video/backlight/arcxcnn_bl.c index 555b036643fb..e610d7a1d13d 100644 --- a/drivers/video/backlight/arcxcnn_bl.c +++ b/drivers/video/backlight/arcxcnn_bl.c @@ -130,12 +130,9 @@ static int arcxcnn_set_brightness(struct arcxcnn *lp, u32 brightness) static int arcxcnn_bl_update_status(struct backlight_device *bl) { struct arcxcnn *lp = bl_get_data(bl); - u32 brightness = bl->props.brightness; + u32 brightness = backlight_get_brightness(bl); int ret; - if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) - brightness = 0; - ret = arcxcnn_set_brightness(lp, brightness); if (ret) return ret; -- 2.30.2