Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2148970iof; Tue, 7 Jun 2022 21:23:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXRrLMRxjgUFPin/XUgDMZJCaxE4Edy/ND4+mftL9V8hxQQi4ZO4idOcQipX3s+m2I6bxJ X-Received: by 2002:a05:6a00:1902:b0:4fa:fa9e:42e6 with SMTP id y2-20020a056a00190200b004fafa9e42e6mr60844055pfi.1.1654662184616; Tue, 07 Jun 2022 21:23:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654662184; cv=none; d=google.com; s=arc-20160816; b=BEbIuuQ+EgNdIQQ2AFPkW5Ucc2nMYZQ/dEHy4QRArSLYd/g+nBX930X1fvcWieUvpc k/dkHpCKlXPV8bR4raBXtQy1r5wfgH5r12Zp76Kz4xfq9QcHa25MCkFnEr9ONNWj5se4 O4IN8X6xuc6Z1jTDBz+aQCcSh70HKuXMixf85p3AyQdAc8Q5OiVHG6UIGN3aSu6zdERd 43pIbuzwvoYzdmzR7LuJiRKEM97XjdCLqLC4mLZhUSTpVQotXhaNcINRh7NbqZpI+CsB 82wrnbVQXEpmcjI0X+ffd0dcLHpuch3fp4nzRWFB04AqUExEfAtPiiiH5AMrB0Bn5gwI 6n3Q== 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=Qww34FfypEWFnGBDxQA/fM4Vzek5oyKhDbz7gy7xRAg=; b=WrFVlUwnPnNCWWGRrICrlw9nVnweCUSkeIurPGSHHbPXuuX+xnBPEP2vlYwyoeZLXo SHJgIUGM5EgnR9x1ifF9Bf3QnMC3SDWdM+zQBvfhL7vNeVHEPNFcxLO1Dw3mQMQIKYxF XFmzKvzQ0BWqZyNybvZ4Lu1aXVCFl0VN24ZIihnQPKdclBPJSGexqfVl7XTGB7cVeQ/q YGDpTwfF7xGWfKK1upTD4vTKXearIVD2Zj2D/PtpYgFAqR0SQcNdnjH0+jrPovtenbB4 doPv/8GWovNm7vfWtZ52mI0Ox+IBQ9BjOd0KtpbBqCFYC2ohR4b30bRnS5TMb+oqnRiN 54Hw== 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 lw17-20020a17090b181100b001dc62080a06si22300626pjb.74.2022.06.07.21.23.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:23:04 -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 BC0572ACB4B; Tue, 7 Jun 2022 21:11:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1382889AbiFGV4N (ORCPT + 99 others); Tue, 7 Jun 2022 17:56:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379285AbiFGVCT (ORCPT ); Tue, 7 Jun 2022 17:02:19 -0400 X-Greylist: delayed 1149 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Tue, 07 Jun 2022 11:47:31 PDT 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 4AFBE737A3 for ; Tue, 7 Jun 2022 11:47:31 -0700 (PDT) Received: from player796.ha.ovh.net (unknown [10.108.1.219]) by mo560.mail-out.ovh.net (Postfix) with ESMTP id 8B96D2466E for ; Tue, 7 Jun 2022 18:47:29 +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 5FF732B43742E; Tue, 7 Jun 2022 18:47:20 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R0036d2f136e-90d2-4dc0-b8df-64c2249e2f69, 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 3/4] platform/x86: compal-laptop: Use backlight helper Date: Tue, 7 Jun 2022 20:46:34 +0200 Message-Id: <20220607184635.1127913-4-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: 11331338138328008326 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedruddthedguddvlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeeghffhleeigffhteeiffelveefhfeiudehkedtgefhgedvleffgfejgfdtveeigeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepvdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejleeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheeitd 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 manually checking the power state in struct backlight_properties, use backlight_is_blank(). Signed-off-by: Stephen Kitt Cc: Cezary Jackiewicz Cc: Hans de Goede Cc: Mark Gross Cc: platform-driver-x86@vger.kernel.org --- drivers/platform/x86/compal-laptop.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c index ab610376fdad..0942f50bd793 100644 --- a/drivers/platform/x86/compal-laptop.c +++ b/drivers/platform/x86/compal-laptop.c @@ -324,9 +324,7 @@ static int bl_update_status(struct backlight_device *b) if (ret) return ret; - set_backlight_state((b->props.power == FB_BLANK_UNBLANK) - && !(b->props.state & BL_CORE_SUSPENDED) - && !(b->props.state & BL_CORE_FBBLANK)); + set_backlight_state(!backlight_is_blank(b)); return 0; } -- 2.30.2