Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2197867iof; Tue, 7 Jun 2022 22:57:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx68I+DIWHirTf1dw62tKRsoPtZ1uljAVDvnsdAm7H7vQAgZxp4iuoOpO72fCjBSazHGznh X-Received: by 2002:a65:6a47:0:b0:3f5:d7a8:44ee with SMTP id o7-20020a656a47000000b003f5d7a844eemr28856590pgu.330.1654667858885; Tue, 07 Jun 2022 22:57:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654667858; cv=none; d=google.com; s=arc-20160816; b=wsBPppRYG6gTW40axs7e+3VXC7gJuAkfK0YJNJc3IHQjf1qluY3JWc0/h1E3CnghwI wskJQodt4QEsbHokyAOfKnJM6vSo3jH4lVbD6qPU/e1+D7rSM3L/PGxztSj+nvSN+NeR F7O/a4vIXwTVSB3rOcE8wr2tkFtc1fnKW1zPiC8yqdAyycyhCS3Zpr/97Ez885Ux7mCq AZ+XhyCM+aO298yl4yuOBy1hn+JAsCwYvfvocOez6oJ/OeJmjRb94pTNJ7CH2RksB2Z2 IQjpmO6FCW9pNuELRRozn1ohQgBHNmH9YepDn+GQUCMiIAhO9gS0sIS9adNKA2wUWHmv xAnQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=QhN5AfRBWmh7ZCUY0sE8n+K5P1UW2yX7UuK2M4Xx1G0=; b=qmMB7JUcqzMDKhD8IxPC3rLmcqD3Q0bbNqNEk+t5b5DYpDMyldc/D13T61BWn8oTwC EyZhzz8WlcGVYEAxmo8PfIuUCVTCwAieUu1W1yK0gWPfvvw4R8uYSw1td/CIKZxgHGet dh6Li3cdOCZ+cxvvfhrBK0OF+2lt8ta2EmpChAwGfP8UCh/RoxlQhaQrQymY6vovO1Yd s3ENEYWqWuG9U9iy/yia0SHGCR66yV/yL9Moc1eqMLdv4nJmj5rrNdgbOKngw72DGS46 EceFKSIJHfuBOiNbwLvNKvFg483UzfECZIhcNi0TUvUaCHGUg0/CBAjT/UHFEDgMaRwV z8cg== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i11-20020a17090332cb00b001640aae96e8si25227174plr.317.2022.06.07.22.57.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 22:57:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id EC6D94B4163; Tue, 7 Jun 2022 22:23:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383660AbiFHBEk (ORCPT + 99 others); Tue, 7 Jun 2022 21:04:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382966AbiFGVwI (ORCPT ); Tue, 7 Jun 2022 17:52:08 -0400 X-Greylist: delayed 538 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 12:10:08 PDT Received: from 3.mo575.mail-out.ovh.net (3.mo575.mail-out.ovh.net [46.105.58.60]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21170434A4 for ; Tue, 7 Jun 2022 12:10:08 -0700 (PDT) Received: from player797.ha.ovh.net (unknown [10.109.138.131]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 60A9224473 for ; Tue, 7 Jun 2022 19:10:06 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player797.ha.ovh.net (Postfix) with ESMTPSA id 4E982273DCAD8; Tue, 7 Jun 2022 19:09:57 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-102R004f66d6445-5b4d-4b53-8766-d6f361bee8fc, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Lee Jones , Daniel Thompson , Jingoo Han , Helge Deller Cc: dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH 2/4] backlight: arcxcnn: Use backlight helper Date: Tue, 7 Jun 2022 21:09:23 +0200 Message-Id: <20220607190925.1134737-3-steve@sk2.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607190925.1134737-1-steve@sk2.org> References: <20220607190925.1134737-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11713299682955658886 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedgudeffecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleejrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheejhe X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han Cc: Helge Deller Cc: dri-devel@lists.freedesktop.org Cc: linux-fbdev@vger.kernel.org --- 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 7b1c0a0e6cad..a706899eb7ac 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