Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1951854iof; Tue, 7 Jun 2022 15:19:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxb2y4iCgGpNxYw1jJSaWnXPUml4UGdrbQq4A/4yirxXoegS+CiPIajw1R8xwU72uDyDhol X-Received: by 2002:a17:906:58c9:b0:6fd:f4fe:800a with SMTP id e9-20020a17090658c900b006fdf4fe800amr29260959ejs.285.1654640348995; Tue, 07 Jun 2022 15:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654640348; cv=none; d=google.com; s=arc-20160816; b=OPXPjMurH/7H0E+CapyZtJB73bPEBCHKZva+DqbJbamkt7Ur7TdUYoEF78IT/nBYWq TtLCT4e6xyupHAGFtmMPouAymnbgTJmeibsBgSOhXmedz3Uud7T1LSRnBF8+bay2BC9X T+p4/M8TK/gc9P1qQsXjHFIis7m2xsYAYCNax6MKbMtgbP9NBxATUsqhXIvsxqvZp4+b OjmUc49PvHpOB+uEy7IExRvvtVJFeyrMJKXAL1x2LDIFb8dNLLt8pjAIXO2yuXhgw/DA LXkBe3P7zff2ImZJU1k+ZS6rMHL0LzFJGDAThw9uziFheqrTc7RvHfm/9j7ffQHMOIkG Q9KQ== 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=fl4i4nPBzLJoYcA+QUN+CdbiH6VvAvWdE7vltSegXXU=; b=0CEqQblXYe0Gveqo+Qi6GLPYPBYVltCd/lg5KnYhA9SwXtZJOpKtevvCFKUTKCi7z+ pJxc9/P/uOWW9yKw0KSV36fv09anxqM+2sOaIPqTj65r8gQV7fX11SZmLsLYM8euR3Pg Q3gOOY04Ckpe3SIfGQyQb2WqC7rS4roydh5qMRPONEKWjSjLgrNnnbg0jl959FrFgWnx 9PPXnQXx+M+BdnGV+IVn6D/7fWWv5L/fMIuGy/mFkONmhPAXbCEeyw4FUvFSWk2ExYfT 3rCrrbFPqnLtExl6EGZArCR8DQNFW4iL0chPDkGu+WkSZsV8yKxEcxEYOGvB9JF5t6D2 vwJQ== 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 he6-20020a1709073d8600b00710fb1685ecsi19215508ejc.272.2022.06.07.15.18.33; Tue, 07 Jun 2022 15:19:08 -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 S1384791AbiFGWQT (ORCPT + 99 others); Tue, 7 Jun 2022 18:16:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35592 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380110AbiFGVLa (ORCPT ); Tue, 7 Jun 2022 17:11:30 -0400 Received: from 1.mo560.mail-out.ovh.net (1.mo560.mail-out.ovh.net [46.105.63.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3FC8721788D for ; Tue, 7 Jun 2022 11:53:11 -0700 (PDT) Received: from player796.ha.ovh.net (unknown [10.108.20.107]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 7207E24673 for ; Tue, 7 Jun 2022 18:47:11 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player796.ha.ovh.net (Postfix) with ESMTPSA id BF54F2B4373C7; Tue, 7 Jun 2022 18:47:02 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003d02dbf92-065a-4f26-9890-0ee8986a4b9e, 38FB55E0ED6224772C245AF554E1AE62085133ED) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: "Lee, Chun-Yi" , Hans de Goede , Mark Gross , Cezary Jackiewicz , Henrique de Moraes Holschuh Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH 1/4] platform/x86: acer-wmi: Use backlight helper Date: Tue, 7 Jun 2022 20:46:32 +0200 Message-Id: <20220607184635.1127913-2-steve@sk2.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220607184635.1127913-1-steve@sk2.org> References: <20220607184635.1127913-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 11326271589753915014 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedguddvlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeitd 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 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, Chun-Yi" Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org --- drivers/platform/x86/acer-wmi.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c index 9c6943e401a6..e0230ea0cb7e 100644 --- a/drivers/platform/x86/acer-wmi.c +++ b/drivers/platform/x86/acer-wmi.c @@ -1615,12 +1615,7 @@ static int read_brightness(struct backlight_device *bd) static int update_bl_status(struct backlight_device *bd) { - int intensity = bd->props.brightness; - - if (bd->props.power != FB_BLANK_UNBLANK) - intensity = 0; - if (bd->props.fb_blank != FB_BLANK_UNBLANK) - intensity = 0; + int intensity = backlight_get_brightness(bd); set_u32(intensity, ACER_CAP_BRIGHTNESS); -- 2.30.2